> For the complete documentation index, see [llms.txt](https://zcjian.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zcjian.gitbook.io/project/string/untitled-1.md).

# Multiply Strings

LeetCode 43

```python
class Solution:
    def multiply(self, num1, num2):
        """
        :type num1: str
        :type num2: str
        :rtype: str
        """
        """
        思路:
            123    nums2
          *  23    nums1
        ----------
            369
           246 
        """
        res = [0]* (len(num1) + len(num2))
        for i, v1 in enumerate(reversed(num1)):
            for j, v2 in enumerate(reversed(num2)):
                res[i+j] = res[i+j] + int(v1) * int(v2)
                res[i+j+1] = int (res[i+j+1] + res[i+j]/10)
                res[i+j] %= 10
        
        while res[-1] == 0 and len(res) > 1:
            res.pop()
            
        return "".join(map(str, res[::-1]))
```
