<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 {
private:
string convertLessThanThousand(int num){
    vector<string>belowTwenty={"","One","Two","Three","Four","Five","Six","Seven", "Eight", "Nine", "Ten",
                                  "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"};
    vector<string> tens = {"", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"};

    string result;
   if(num<20){
    return belowTwenty[num];
   }
   else if(num<100){
    result=tens[num/10]+((num%10)? " "+belowTwenty[num%10] : "");
   }
   else{
    result=belowTwenty[num/100]+" Hundred" + ((num%100) ? " "+convertLessThanThousand(num%100) : "");
   }
   return result;
}
public:
    string numberToWords(int num) {
        if(num==0) return "Zero";
        int i=0;
        string result="";
        vector<string> thousands={"","Thousand","Million","Billion"};
        while(num>0){
            if(num%1000 != 0){
                result=convertLessThanThousand(num%1000)+(thousands[i].empty()? "":" "+thousands[i])+(result.empty()? "" : " "+result);
            }
            num/=1000;
            i++;
        }
        return result;

    }
};
12600