<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>&nbsp;You must not use any built-in BigInteger library or convert the inputs to integer directly.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
<pre><strong>Input:</strong> num1 = "2", num2 = "3"
<strong>Output:</strong> "6"
</pre><p><strong class="example">Example 2:</strong></p>
<pre><strong>Input:</strong> num1 = "123", num2 = "456"
<strong>Output:</strong> "56088"
</pre>
<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= num1.length, num2.length &lt;= 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>&nbsp;do not contain any leading zero, except the number <code>0</code> itself.</li>
</ul>

class Solution {
    string singMultiply (string num1, int num2, int padding){
        int size = num1.size(); string singProduct;
        stack <int> digits;
        int carry {0};
        for (int i = size - 1; i >= 0; i--){
            int tempProduct = (num1[i] - '0') * num2 + carry;
            digits.push(tempProduct % 10);
            carry = tempProduct / 10;
        }
        while (carry > 0) {digits.push(carry % 10); carry /= 10;}
        while (!digits.empty()){singProduct += (digits.top() + '0'); digits.pop();}
        while (padding != 0){singProduct += '0'; padding--;}
        reverse(singProduct.begin(), singProduct.end());
        return singProduct;
    }
    string addition (vector <string> nums, int size){
        string product; int addSize = nums[size - 1].size();
        stack <int> digits;
        int carry {0};
        for (int i = 0; i < addSize; i++){
            int singSum {0};
            for (int j = 0; j < size; j++){
                if (i >= nums[j].size()) continue;
                singSum += (nums[j][i] - '0');
            }
            singSum += carry;
            digits.push(singSum % 10);
            carry = singSum / 10;
        }
        while (carry > 0) {digits.push(carry % 10); carry /= 10;}
        while (!digits.empty()){product += (digits.top() + '0'); digits.pop();}
        return product;
    }
public:
    string multiply(string num1, string num2) {
        if (num1 == "0" || num2 == "0") return "0";
        int size = num2.size();
        vector <string> nums (size);
        for (int i = size - 1, j = 0; i >= 0; i--, j++)
            nums[j] = singMultiply(num1, num2[i] - '0', j);
        return addition(nums, size);
    }
};
21021