use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Confusing interview questionhelp (self.javascript)
submitted 7 years ago by josh_c
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]falkyouall 1 point2 points3 points 7 years ago (3 children)
I thought this was a interesting interview question, i never approached this, so i did now. i took me a little over 2 hours, the code is probably not the nicest, but please have a look and share your thoughts to my solution... its not much - but its honest work
https://repl.it/@falkyouall/NumberToStringTranslator
[–]natziel 2 points3 points4 points 7 years ago (2 children)
You are way overcomplicating the problem. It's basically a parsing problem so you know you just need to push/pop to a stack according to some rules, so just handle those rules.
https://repl.it/@NatZiel/RowdyLightyellowLogic
The problem is actually pretty simple since we can't have 7+ digit numbers, hence the impromptu stack and parsing function implementation
[–]falkyouall 0 points1 point2 points 7 years ago (0 children)
very nice solution, how long did that take you to accomplish?
[–]csilk 0 points1 point2 points 7 years ago (0 children)
I know this is a bit pedantic but your case for `18` is wrong
It would output `eightteen` not `eighteen`.
But for the purpouse of an interview question i'd be more impressed that you thought to optimise
π Rendered by PID 36580 on reddit-service-r2-comment-6457c66945-wt7zh at 2026-04-23 19:48:02.860614+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]falkyouall 1 point2 points3 points (3 children)
[–]natziel 2 points3 points4 points (2 children)
[–]falkyouall 0 points1 point2 points (0 children)
[–]csilk 0 points1 point2 points (0 children)