Take num = 1000010. Peel off groups of from the right: the first group is (), the second group is (), the third group is ().
Process group (value ): convert to "One", attach scale "Million". Group (value ): skip entirely. Group (value ): convert to "Ten", no scale word for the ones group. Combine: "One Million Ten".
Time: . The input is bounded by , which means at most groups of digits. The work per group is constant. Space: . The lookup arrays and output string are bounded by a fixed maximum size regardless of input.