Medium · Math

Multiply Strings

Given two non-negative integers num1 and num2 as decimal strings (no leading zeros except "0" itself), return their product as a decimal string without converting the whole inputs to built-in integers.

Examples

Example 1

{
  "num1": "12",
  "num2": "34"
}

Output: 408

Example 2

{
  "num1": "123",
  "num2": "45"
}

Output: 5535

Rebuild it in the studio

Read every interview problem free. Ten rooms need no account. A token opens a problem in full — Pro never counts.

More Math problems