<p>Convert a non-negative integer <code>num</code> to its English words representation.</p>

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

<pre>
<strong>Input:</strong> num = 123
<strong>Output:</strong> &quot;One Hundred Twenty Three&quot;
</pre>

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

<pre>
<strong>Input:</strong> num = 12345
<strong>Output:</strong> &quot;Twelve Thousand Three Hundred Forty Five&quot;
</pre>

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

<pre>
<strong>Input:</strong> num = 1234567
<strong>Output:</strong> &quot;One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven&quot;
</pre>

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

<ul>
	<li><code>0 &lt;= num &lt;= 2<sup>31</sup> - 1</code></li>
</ul>

class Solution {
public:
    string f(int a,int b,int c){
        // a=0th, b=1st, c=2nh index
 
        string ans;
            if(c==1) ans=ans+ "One ";
            if(c==2) ans=ans+ "Two ";
            if(c==3) ans=ans+ "Three ";
            if(c==4) ans=ans+ "Four ";
            if(c==5) ans=ans+ "Five ";
            if(c==6) ans=ans+ "Six ";
            if(c==7) ans=ans+ "Seven ";
            if(c==8) ans=ans+ "Eight ";
            if(c==9) ans=ans+ "Nine ";
        if(c>0)
        {
            ans=ans+"Hundred ";
        }

        if(b==1){
            if(a==0) ans=ans+ "Ten ";
            if(a==1) ans=ans+ "Eleven ";
            if(a==2) ans=ans+ "Twelve ";
            if(a==3) ans=ans+ "Thirteen ";
            if(a==4) ans=ans+ "Fourteen ";
            if(a==5) ans=ans+ "Fifteen ";
            if(a==6) ans=ans+ "Sixteen ";
            if(a==7) ans=ans+ "Seventeen ";
            if(a==8) ans=ans+ "Eighteen ";
            if(a==9) ans=ans+ "Nineteen ";
        }
        else{
            if(b==2) ans=ans+ "Twenty ";
            if(b==3) ans=ans+ "Thirty ";
            if(b==4) ans=ans+ "Forty ";
            if(b==5) ans=ans+ "Fifty ";
            if(b==6) ans=ans+ "Sixty ";
            if(b==7) ans=ans+ "Seventy ";
            if(b==8) ans=ans+ "Eighty ";
            if(b==9) ans=ans+ "Ninety ";

            if(a==1) ans=ans+ "One ";
            if(a==2) ans=ans+ "Two ";
            if(a==3) ans=ans+ "Three ";
            if(a==4) ans=ans+ "Four ";
            if(a==5) ans=ans+ "Five ";
            if(a==6) ans=ans+ "Six ";
            if(a==7) ans=ans+ "Seven ";
            if(a==8) ans=ans+ "Eight ";
            if(a==9) ans=ans+ "Nine ";
        }
        return ans;
    }
    string numberToWords(int num) {       
         if(num==0){
            return "Zero";
        }
        int a=0;
        string ans;
        while(num>0){
            int b=num%10;
            num=num/10;
            int c=num%10;
            num=num/10;
            int d=num%10;
            num=num/10;
            a++;
            if(a==1) ans=f(b,c,d);
            if(a==2){
                string temp=f(b,c,d);
                if(temp.size()>0)
                    temp=temp+"Thousand ";
                ans=temp+ans;
            }
            if(a==3){
                string temp=f(b,c,d);
                if(temp.size()>0)
                    temp=temp+"Million ";
                ans=temp+ans;
            }
            if(a==4){
                ans=f(b,c,d)+"Billion "+ans;
            }
        }
        if(ans[ans.size()-1]==' ') ans.pop_back();
        return ans;
    }
};
10200