Single Line python solution 95% beat runtime

  • 1

    class Solution(object):
    def multiply(self, num1, num2):
    .........return str(reduce(lambda x, y: x*10 + ord(y)-48, num1, 0) * reduce(lambda x, y: x*10 + ord(y)-48, num2, 0))

  • 0

    You actually unknowingly used "BigInteger" in Python.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.