Your friend Yaʻqūb works the counter at the busiest deli in town, slicing, weighing, and wrapping orders for a never-ending line of hungry customers. To keep things moving, each customer takes a numbered ticket when they arrive.
When it’s time to call the next person, Yaʻqūb reads their number out loud, always in full English words to make sure everyone hears it clearly.
Given a number, your task is to express it in English words exactly as your friend should say it out loud. Yaʻqūb expects to use numbers from 0 up to 999,999,999,999.
Examples:
When the input is outside the supported range (0 to 999,999,999,999 inclusive), throw the string
"input out of range"
(verbatim).
Sign up to Exercism to learn and master Factor with 47 concepts163 exercises, and real human mentoring, all for free.