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 nu…


This content originally appeared on DEV Community and was authored by SalahElhossiny

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))



This content originally appeared on DEV Community and was authored by SalahElhossiny


Print Share Comment Cite Upload Translate Updates
APA

SalahElhossiny | Sciencx (2022-07-02T08:44:21+00:00) Leetcode Solutions: Multiply Strings. Retrieved from https://www.scien.cx/2022/07/02/leetcode-solutions-multiply-strings/

MLA
" » Leetcode Solutions: Multiply Strings." SalahElhossiny | Sciencx - Saturday July 2, 2022, https://www.scien.cx/2022/07/02/leetcode-solutions-multiply-strings/
HARVARD
SalahElhossiny | Sciencx Saturday July 2, 2022 » Leetcode Solutions: Multiply Strings., viewed ,<https://www.scien.cx/2022/07/02/leetcode-solutions-multiply-strings/>
VANCOUVER
SalahElhossiny | Sciencx - » Leetcode Solutions: Multiply Strings. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/07/02/leetcode-solutions-multiply-strings/
CHICAGO
" » Leetcode Solutions: Multiply Strings." SalahElhossiny | Sciencx - Accessed . https://www.scien.cx/2022/07/02/leetcode-solutions-multiply-strings/
IEEE
" » Leetcode Solutions: Multiply Strings." SalahElhossiny | Sciencx [Online]. Available: https://www.scien.cx/2022/07/02/leetcode-solutions-multiply-strings/. [Accessed: ]
rf:citation
» Leetcode Solutions: Multiply Strings | SalahElhossiny | Sciencx | https://www.scien.cx/2022/07/02/leetcode-solutions-multiply-strings/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.