PROBLEM 2
Easy

Multiply Two Numbers

Programming Basics · JavaScript

</>
STATUS Not solved

TASK

Problem

#2

Given two integers `a` and `b` on one line, print their product.

EXAMPLE

Example

Input
6 9
Output
54

LIMITS

Constraints

The input sequence contains at most 100000 elements; numeric values fit in JavaScript `Number`.
📖
LEARN Theory for this problem
+

### Multiply Two Numbers

JavaScript arithmetic works with numeric values stored in variables. A clear solution reads the needed values, computes the formula with `+`, `-`, `*`, `/` or `**`, and prints only the final result.

💡
NEED HELP? Hints
+

['Write the formula using named intermediate values if it contains more than one operation.', 'If you use slicing or position search, verify the range boundaries and the case where the target fragment is at an edge of the string.']

ANSWER Solution
+
const fs = require('fs');
const input = fs.readFileSync(0, 'utf8').trimEnd();
let [a, b] = input.trim().split(/\s+/).filter(Boolean).map(Number);
let result = a * b;
console.log(result);