DEV Community

SalahElhossiny
SalahElhossiny

Posted on

Leetcode Solutions: Multiply Strings

Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.

class Solution(object):
    def multiply(self, num1, num2):
        """
        :type num1: str
        :type num2: str
        :rtype: str
        """

        product = num1 + "*" + num2

        return str(eval(product))


Enter fullscreen mode Exit fullscreen mode

Top comments (0)