Grokking Oracle Coding Interview
Ask Author
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.
  • Example 2:

    • Input: num = 1001
    • Expected Output: "One Thousand One"

.....

.....

.....

Like the course? Get enrolled and start learning!