Multiply Strings LeetCode solution in Python

1
class Solution:
2
def multiply(self, num1: str, num2: str) -> str:
3
def convertToInt(numStr):
4
currNum = 0
5
N = len(numStr)
6
for i in range(N - 1, -1, -1):
7
digit = ord(numStr[i]) - ord("0")
8
currNum += pow(10, N - i - 1) * digit
9

10
return currNum
11

12
n1 = convertToInt(num1)
13
n2 = convertToInt(num2)
14
return str(n1 * n2)

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0