FunctionRacerProblemsRace

Multiply Strings

MediumMathPython, JavaScript, TypeScript, Java, C++

num1 and num2 are non-negative whole numbers written as digit strings. Return their product as a string, with no leading zeros (except for the answer 0). Multiply digit by digit like on paper rather than converting the whole strings to integers.

Example 1

num1 "12"
num2 "12"
returns "144"

12 * 12 = 144.

Example 2

num1 "9"
num2 "0"
returns "0"

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems