<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 {
public:
const int M = 1e9+7;
const int N = 1e6;
#define bg begin()
#define ed end()
#define rbg rbegin()
#define red rend()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define vc vector
#define pr pair
#define sz(x) (int)x.size()
#define nl '\n'
#define unmap unordered_map
typedef long long ll;
typedef unsigned long long ull;
const ll LM = 1e18+7;

    string multiply(string a, string b) {
        int x{}, carry{}, it{};
        vc<vc<int>>matrix;
        for(int i=sz(b)-1;i>=0;i--){
            vc<int>t;
            for(int j=sz(a)-1;j>=0;j--){
                x = (b[i] - '0') * (a[j] - '0') + carry;
                if(j == 0){
                    carry = 0; t.pb( x );
                } else {
                    if(x/10 == 0){
                        carry = 0;
                    } else {
                        carry = x/10; x %= 10;
                    }
                    t.pb( x );
                }
            }
            reverse(t.bg, t.ed);
            for(int j=1;j<=it;j++){
                t.pb(0);
            }
            matrix.pb( t ); it++;
        }
        vc<int>tp;
        carry = 0; string s = "";
        for(int j=sz( matrix[sz( matrix )-1] );j>=1;j--){
            x = 0; 
            for(int i=0;i<sz( matrix );i++){
                if(sz( matrix[i] ) != 0){
                    x += matrix[i].back(); matrix[i].pop_back();
                }
            }
            x += carry;
            if(j == 1){
                tp.pb( x );
            } else {
                if(x/10 == 0){
                    carry = 0;
                } else {
                    carry = x/10;
                    x %= 10;
                }
                tp.pb( x );
            }
        }
        bool fl = 1;
        reverse( tp.bg, tp.ed );
        for(int i=0;i<sz( tp );i++){
            if(fl and tp[i] == 0){
                continue;
            } else {
                s += to_string(tp[i]); fl=0;
            }
        }
        if(s.empty()){
            return "0";
        } else {
            return s;
        }


        
    }
};
21330