Given two numbers represented as strings, return multiplication of the numbers as a string.
Note:
The numbers can be arbitrarily large and are non-negative.
Converting the input string to integer is NOT allowed.
You should NOT use internal library such as BigInteger.
字符串拆分成字符,然后计算,注意进位就行,进位中又要特别注意最高位进位。最开始我用int计算,其实还是逃不过超出范围的限制,所以就用个int的数组,只记录每一位数字,然后用这个数组来构造字符串。
public class Solution {
public String multiply(String num1, String num2) {
int[] res = new int[num1.length() + num2.length()];
int temp = 0, flag =