multiply strings

🏠

https://leetcode.com/problems/multiply-strings/

1 from functools import reduce
2 from string import digits
3 
4 
5 class Solution:
6     def multiply(self, num1: str, num2: str) -> str:
7         a = reduce(lambda acc, n: acc * 10 + digits.index(n), num1, 0)
8         b = reduce(lambda acc, n: acc * 10 + digits.index(n), num2, 0)
9         return str(a * b)