Good afternoon! Here's our prompt for today.
Can you convert a number to its text equivalent? This is otherwise known as number spelling.

For example, given 1234, we expect to get "one thousand two hundred and thirty four" back.
Constraints
- The given number will have <=
100digits - 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?
xxxxxxxxxx18
var assert = require('assert');​function numberToWords(n) { // convert n to words return n;}​try { assert.equal(numberToWords(1234), 'one thousand two hundred and thirty four');​ console.log( 'PASSED: ' + "assert.equal(numberToWords(1234), 'one thousand two hundred and thirty four');" );} catch (err) { console.log(err);}​OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment
Here's our guided, illustrated walk-through.
How do I use this guide?

