Multiply Strings
Multiply two nonnegative integers given as decimal strings and return a decimal string. Do not convert the whole input strings to big integers.
Example 1
num1 = "12"
num2 = "34""408"Explanation
1234=1230+12*4=360+48=408.
Example 2
num1 = "0"
num2 = "987""0"Explanation
Multiplying by zero gives the canonical string 0.
Example 3
num1 = "99"
num2 = "99""9801"Explanation
99*99=9801; decimal carries produce four digits.
Constraints
- 1 <= string lengths <= 200
- Strings contain digits and have no leading zeros except zero itself
Function contract
multiplyArguments: json, jsonSolutionRuns on your device
Loading draft…
Run: 3 examples; Submit: 34 cases, on your device.
"12""34"