Get Mystery Box with random crypto!

Multiply Strings Given two numbers represented as strings, re | Cse interview questions

Multiply Strings

Given two numbers represented as strings, return multiplication of the numbers as a string.

NOTE :

1. The numbers can be arbitrarily large and are non-negative.

2. Answer should not have leading zeroes. For example, "082" is not a valid answer. Instead "82" should be returned.

3. Do not use built-in big integer libraries available in programming languages like Java and Python.

4. Do not convert the inputs to integer to solve the problem.

Examples :

Input 1 : num1 = "12", num2 = "11"

Output 1 : "132"

Explanation 1 :

Numbers 12 and 11 when multiplied yields 132. Return answer in string format.

Input 2 : num1 = "4983", num2 = "2727"

Output 2 : "13588641"

Explanation 2 :

Numbers 4983 and 2323 when multiplied yields 13588641. Return answer in string format.

Topic : Strings

Reference -> InterviewBit, LeetCode

Solution -> GeeksforGeeks

Asked in Google, Microsoft

Join our Official Channel @cseinterview