<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:
void fillZeros(string& s1, string& s2)
{
    //s1 je manji

    int n1=s1.length();
    int n2=s2.length();

    string s="";

    for(int i=0;i<n2-n1;i++)
        s+='0';

    s+=s1;

    s1=s;

}

string add(string s1, string s2)
{
    string sol="";
    int change=0;
    if(s1.length() < s2.length())
        fillZeros(s1,s2);
    else
        fillZeros(s2,s1);

    int n=s1.length();
    int p,q;

    for(int i=n-1;i>-1;i--)
    {
        p=s1[i]-'0';
        q=s2[i]-'0';

        p=p+q+change;
        sol+=(p%10+'0');
        change=p/10;
    }

    reverse(sol.begin(), sol.end());
    if(change)
        sol=char (change+'0')+sol;


    return sol;

}

string mul(string s, char c)
{
    int i=s.length()-1;
    string sol="";
    int k=c-'0';
    int p;
    int change=0;
    while(i>-1)
    {
        p=s[i]-'0';
        p=p*k+change;
        sol+=to_string(p%10);
        change=p/10;
        i--;
    }

    reverse(sol.begin(), sol.end());
    if(change)
        sol=char (change+'0')+sol;


    return sol;
}

string multiply(string num1, string num2) {
    if(num1=="0" || num2=="0") return "0";
     int i=num1.length()-1;
     vector<string> results;
     string zeros="";
     string temp;
     while(i>-1)
     {
         temp=mul(num2,num1[i--]);
         temp+=zeros;
         zeros+="0";
         results.push_back(temp);

     }

     string sol="0";

     for(const auto& j : results)
         sol=add(sol,j);

     return sol;


}
};
21948