<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:
    def numberToWords(self, num: int) -> str:
        if num == 0:
            return 'Zero'

        below20 = [
            '', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine',
            'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen'
        ]
        tens = ['', '', 'Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety']
        thousands = ['', 'Thousand', 'Million', 'Billion', 'Trillion']

        def hundreds(num: int) -> str:
            if num < 20:
                return below20[num]
            elif num < 100:
                arr = [tens[num // 10]]
                if num % 10 != 0:
                    arr.append(below20[num % 10])
                return ' '.join(arr)
            else:
                arr = [below20[num // 100], 'Hundred']
                if num % 100 != 0:
                    arr.append(hundreds(num % 100))
                return ' '.join(arr)

        txts = []
        i = 0
        while num != 0:
            if num % 1000 != 0:
                if 0 < i:
                    txts.insert(0, thousands[i])
                txts.insert(0, hundreds(num % 1000))
            num //= 1000
            i += 1
        return ' '.join(txts)
16100