@@ -0,0 +1,1200 @@
+package math;%0A%0A/**%0A * https://oj.leetcode.com/problems/multiply-strings/%0A * Given two numbers represented as strings, return multiplication of the numbers as a string.%0A * Note: The numbers can be arbitrarily large and are non-negative.%0A */%0Apublic class MultiplyStrings %7B%0A    public String multiply(String num1, String num2) %7B%0A        int l1 = num1.length(), l2 = num2.length();%0A        StringBuilder tmp1 = new StringBuilder(num1).reverse();%0A        StringBuilder tmp2 = new StringBuilder(num2).reverse();%0A        int l = l1 + l2;%0A        int%5B%5D res = new int%5Bl + 1%5D;%0A        for (int i = 0; i %3C l1; i++) %7B%0A            int a1 = tmp1.charAt(i) - '0';%0A            for (int j = 0; j %3C l2; j++) %7B%0A                int a2 = tmp2.charAt(j) - '0';%0A                res%5Bi + j%5D += a1 * a2;%0A            %7D%0A        %7D%0A        StringBuilder sb = new StringBuilder();%0A        for (int i = 0; i %3C l; i++) %7B%0A            int digit = res%5Bi%5D %25 10;%0A            int carry = res%5Bi%5D / 10;%0A            res%5Bi + 1%5D = +carry;%0A            sb.insert(0, digit);%0A        %7D%0A        while (sb.length() %3E 0 && sb.charAt(0) == '0') %7B%0A            sb.deleteCharAt(0);%0A        %7D%0A        return sb.length() == 0 ? %220%22 : sb.toString();%0A    %7D%0A%7D%0A

multiply strings