Back to course home
0% completed
Solution: Integer to English Words
Problem Statement
Given a positive integer num
, return the English word
representation of num
.
Examples
-
Example 1:
- Input: num =
12345
- Expected Output:
"Twelve Thousand Three Hundred Forty Five"
- Justification: The number 12345 is broken down into "Twelve Thousand" for the first two digits, followed by "Three Hundred" for the next digit, and "Forty Five" for the last two digits.
- Input: num =
-
Example 2:
- Input: num =
1001
- Expected Output:
"One Thousand One"
- Input: num =
.....
.....
.....
Like the course? Get enrolled and start learning!