Mark As Completed Discussion

Good evening! Here's our prompt for today.

Can you convert a number to its text equivalent? This is otherwise known as number spelling.

Description

For example, given 1234, we expect to get "one thousand two hundred and thirty four" back.

Constraints

  • The given number will have <= 100 digits
  • Let n be the number of digits
  • Expected time complexity : O(n)
  • Expected space complexity : O(n)

Try to solve this here or in Interactive Mode.

How do I practice this challenge?

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment

We'll now take you through what you need to know.

How do I use this guide?