@@ -0,0 +1,2068 @@
+%22%22%22Multiply Strings%0AGiven two non-negative integers num1 and num2 represented as strings, return the product of%0Anum1 and num2, also represented as a string.%0A%0AExample 1:%0A%0A    Input: num1 = %222%22, num2 = %223%22%0A    Output: %226%22%0A%0AExample 2:%0A%0A    Input: num1 = %22123%22, num2 = %22456%22%0A    Output: %2256088%22%0A%0ANote:%0A%0A    1. The length of both num1 and num2 is %3C 110.%0A    2. Both num1 and num2 contain only digits 0-9;%0A    3. Both num1 and num2 do not contain any leading zero, except the number 0 itself.%0A    4. You must not use any built-in BigInteger library or convert the inputs to integer%0A       directly.%0A%22%22%22%0A%0A%0Aclass Solution:%0A%0A    def multiply(self, num1: str, num2: str) -%3E str:%0A        num1 = num1%5B::-1%5D%0A        num2 = num2%5B::-1%5D%0A%0A        arr = %5B0%5D * (len(num1) + len(num2))%0A        # arr = %5B0 for i in range(len(num1) + len(num2))%5D%0A        for i in range(len(num1)):%0A            for j in range(len(num2)):%0A                arr%5Bi + j%5D += int(num1%5Bi%5D) * int(num2%5Bj%5D)%0A%0A        ans = %5B%5D%0A        for i in range(len(arr)):%0A            digit = arr%5Bi%5D %25 10%0A            carry = arr%5Bi%5D // 10%0A            if i %3C len(arr) - 1:%0A                arr%5Bi + 1%5D += carry%0A            ans.insert(0, str(digit))%0A%0A        while ans%5B0%5D == '0' and len(ans) %3E 1:%0A            del ans%5B0%5D%0A        return ''.join(ans)%0A%0A%0Aclass SolutionB:%0A%0A    def multiply(self, num1: str, num2: str) -%3E str:%0A        if num1 == '0' or num2 == '0':%0A            return '0'%0A        ans = 0%0A        for i, n1 in enumerate(num2%5B::-1%5D):%0A            pre = 0%0A            curr = 0%0A            for j, n2 in enumerate(num1%5B::-1%5D):%0A                multi = (ord(n1) - ord('0')) * (ord(n2) - ord('0'))%0A                first, second = multi // 10, multi %25 10%0A                curr += (second + pre) * (10**j)%0A                pre = first%0A            curr += pre * (10**len(num1))%0A            ans += curr * (10**i)%0A        return str(ans)%0A%0A%0Aif __name__ == '__main__':%0A    cases = %5B(('2', '3'), '6'), (('123', '456'), '56088')%5D%0A%0A    for case in cases:%0A        for S in %5BSolution, SolutionB%5D:%0A            assert S().multiply(*case%5B0%5D) == case%5B1%5D%0A

Add leetcode 043 solution