285. Integer to English Words

HardStringString

Convert a non-negative integer to its English words representation. Words are separated by single spaces with standard capitalization (e.g. 'One Hundred Twenty Three').

Input: A non-negative integer (0 to 2^31 - 1).

Output: Quoted string — English words.

Examples

Example 1
Input: 123
Output: "One Hundred Twenty Three"
Explanation: 123 in words.
Example 2
Input: 12345
Output: "Twelve Thousand Three Hundred Forty Five"
Explanation: With thousands.
Example 3
Input: 0
Output: "Zero"
Explanation: Zero case.

Constraints

Asked by

MicrosoftAmazonAppleOracleMetaGoogle
Solve this problem in the editor →