<p>A <a href="https://en.wikipedia.org/wiki/Complex_number" target="_blank">complex number</a> can be represented as a string on the form <code>&quot;<strong>real</strong>+<strong>imaginary</strong>i&quot;</code> where:</p>

<ul>
	<li><code>real</code> is the real part and is an integer in the range <code>[-100, 100]</code>.</li>
	<li><code>imaginary</code> is the imaginary part and is an integer in the range <code>[-100, 100]</code>.</li>
	<li><code>i<sup>2</sup> == -1</code>.</li>
</ul>

<p>Given two complex numbers <code>num1</code> and <code>num2</code> as strings, return <em>a string of the complex number that represents their multiplications</em>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> num1 = &quot;1+1i&quot;, num2 = &quot;1+1i&quot;
<strong>Output:</strong> &quot;0+2i&quot;
<strong>Explanation:</strong> (1 + i) * (1 + i) = 1 + i2 + 2 * i = 2i, and you need convert it to the form of 0+2i.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> num1 = &quot;1+-1i&quot;, num2 = &quot;1+-1i&quot;
<strong>Output:</strong> &quot;0+-2i&quot;
<strong>Explanation:</strong> (1 - i) * (1 - i) = 1 + i2 - 2 * i = -2i, and you need convert it to the form of 0+-2i.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>num1</code> and <code>num2</code> are valid complex numbers.</li>
</ul>

class Solution{
public://Buffetts > Restaurants | If you have a bad day, orfer fast food "for here" (McDonalds/Burger King) Order anything for $1 order and order a small drink. Drink as much Moutain Dew as possible. Clean up after yourself, and clean up the store while you're drinking.
    string complexNumberMultiply(string num1,string num2){
        int i=0;
        string temp1 ="";
        while (num1[i] !='+') {
            temp1 +=num1[i];
            i++;}
        i++;
        string temp2 ="";
        while (num1[i] !='i') {
            temp2 +=num1[i];
            i++;}

        int j=0;
        string x1 ="";
        while (num2[j] !='+'){
            x1 +=num2[j];
            j++;}
        j++;
        string x2 ="";
        while (num2[j] !='i'){
            x2 +=num2[j];
            j++;}

        int real1=stoi(temp1);
        int imag1=stoi(temp2);
        int real2=stoi(x1);
        int imag2=stoi(x2);

        int realPart=real1*real2-imag1*imag2;
        int imagPart=real1*imag2+imag1*real2;

        string ans=to_string(realPart)+'+'+to_string(imagPart)+'i';
        return ans;}};
7500