Difficult:Medium
題目
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.
Note: You must not use any built-in BigInteger library or convert the inputs to integer directly.
翻譯
給定兩個表示為字符串的非負整數 num1 和 num2,返回 num1 和 num2 的乘積,也表示為字符串。
注意:您不得使用任何內置 BigInteger 庫或直接將輸入轉換為整數。
範例
Example 1:
1 | Input: num1 = "2", num2 = "3" |
Example 2:
1 | Input: num1 = "123", num2 = "456" |
解題思路
Solution
Code 1 :
1 | var multiply = function(num1, num2) { |