<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 numberToWords(int num) {
    if(num == 0) return "Zero";

    std::vector<std::string> number_words {
        "", "One ", "Two ", "Three ", "Four ", "Five ", "Six ", "Seven ", "Eight ", "Nine ",
        "Ten ", "Eleven ", "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ", "Sixteen ", "Seventeen ", "Eighteen ", "Nineteen ",
        "Twenty ", "Twenty One ", "Twenty Two ", "Twenty Three ", "Twenty Four ", "Twenty Five ", "Twenty Six ", "Twenty Seven ", "Twenty Eight ", "Twenty Nine ",
        "Thirty ", "Thirty One ", "Thirty Two ", "Thirty Three ", "Thirty Four ", "Thirty Five ", "Thirty Six ", "Thirty Seven ", "Thirty Eight ", "Thirty Nine ",
        "Forty ", "Forty One ", "Forty Two ", "Forty Three ", "Forty Four ", "Forty Five ", "Forty Six ", "Forty Seven ", "Forty Eight ", "Forty Nine ",
        "Fifty ", "Fifty One ", "Fifty Two ", "Fifty Three ", "Fifty Four ", "Fifty Five ", "Fifty Six ", "Fifty Seven ", "Fifty Eight ", "Fifty Nine ",
        "Sixty ", "Sixty One ", "Sixty Two ", "Sixty Three ", "Sixty Four ", "Sixty Five ", "Sixty Six ", "Sixty Seven ", "Sixty Eight ", "Sixty Nine ",
        "Seventy ", "Seventy One ", "Seventy Two ", "Seventy Three ", "Seventy Four ", "Seventy Five ", "Seventy Six ", "Seventy Seven ", "Seventy Eight ", "Seventy Nine ",
        "Eighty ", "Eighty One ", "Eighty Two ", "Eighty Three ", "Eighty Four ", "Eighty Five ", "Eighty Six ", "Eighty Seven ", "Eighty Eight ", "Eighty Nine ",
        "Ninety ", "Ninety One ", "Ninety Two ", "Ninety Three ", "Ninety Four ", "Ninety Five ", "Ninety Six ", "Ninety Seven ", "Ninety Eight ", "Ninety Nine "
    };


    std::vector<std::string> scale_words { "", "Thousand ", "Million ", "Billion ", "Trillion " };


    std::string result = "";
    int conversion_num, count = 0;

    while(num > 0)
    {
        conversion_num = num%1000;
        num /= 1000;

        if(conversion_num != 0) 
        {
            if(conversion_num >= 100) result = number_words[conversion_num/100] + "Hundred " + number_words[conversion_num%100] + scale_words[count] + result;
            else result = number_words[conversion_num%100] + scale_words[count] + result;
        }

        ++count;
    }

    result.pop_back();
    return result;
    }
};
12700