Class Solution

java.lang.Object
g0001_0100.s0043_multiply_strings.Solution

public class Solution extends Object
43 - Multiply Strings.<p>Medium</p> <p>Given two non-negative integers <code>num1</code> and <code>num2</code> represented as strings, return the product of <code>num1</code> and <code>num2</code>, also represented as a string.</p> <p><strong>Note:</strong> You must not use any built-in BigInteger library or convert the inputs to integer directly.</p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> num1 = &ldquo;2&rdquo;, num2 = &ldquo;3&rdquo;</p> <p><strong>Output:</strong> &ldquo;6&rdquo;</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> num1 = &ldquo;123&rdquo;, num2 = &ldquo;456&rdquo;</p> <p><strong>Output:</strong> &ldquo;56088&rdquo;</p> <p><strong>Constraints:</strong></p> <ul> <li><code>1 <= num1.length, num2.length <= 200</code></li> <li><code>num1</code> and <code>num2</code> consist of digits only.</li> <li>Both <code>num1</code> and <code>num2</code> do not contain any leading zero, except the number <code>0</code> itself.</li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details