Multiply Strings
Given two non-negative integers num1 and num2 represented as strings, return their product also as a string. You must not convert the inputs to integers directly or use any big-integer library.
Open official problem prompt ↗Compute the exact product of two arbitrarily large integers given as text, without relying on the language's native integer arithmetic.
It is the long-multiplication you did on paper: multiply each digit pair, place it in the right column, and carry overflow leftward.
- Input
- num1 = "123", num2 = "456"
- Output
- "56088"
- Why
- 123 * 456 = 56088, computed digit by digit without native integer conversion.
1 <= num1.length, num2.length <= 200num1 and num2 consist of digits onlyNeither has a leading zero, except the number 0 itself