43. Multiply Strings
# Medium
Key idea:
num1[x]*num2[y]
will occupyresult[x+y]
(high digit) andresult[x+y+1]
(low digit)num1*num2
have at mostlen(num1)+len(num2)
digits.
Solution:
define result list
multiply each pair
convert into string, remove high digit which is 0
result
list = [high digit, ..., low digit]
思路不是特别难,但是要一次性写对太不容易了
Time complexity = Space complexity =
Last updated