Number to Digit Words

Given a non-negative integer n, return its decimal digits written as lowercase English words. Translate each digit independently and preserve its original…

Given a non-negative integer `n`, return its decimal digits written as lowercase English words. Translate each digit independently and preserve its original position. Separate adjacent words with exactly one space, with no leading or trailing whitespace. For example, `234` becomes `"two three four"`; this problem does not ask for the cardinal phrase `"two hundred thirty four"`.

- `0 <= n <= 10^9` - The result uses the words `zero` through `nine`, separated by one ASCII space.

Example 1: input n = 234; output "two three four". Each decimal digit is translated independently from left to right.

Example 2: input n = 1005; output "one zero zero five". Zero digits inside the number keep their positions in the output.

Example 3: input n = 0; output "zero". The number zero has one decimal digit, so its result is the single word zero.

Category: Math. Topic: math. Difficulty: Easy. Patterns: math.