This took me a while:
const coinCombo = [25, 10, 5, 1] .reduceRight((a, c) => n => [Math.floor(n/c), ...a(n % c)], () => [])
I believe that understanding the solution is part of the fun, so I usually don't add explanation here not to ruin that deduction exercise. Though, I'd be happy to explain/discuss it if someone asks. Is that ok? Michael, what do you think?
Hey Kostia,
nice solution. Think I never used reduceRight in real life. Sure, you can do that!
reduceRight
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This took me a while:
I believe that understanding the solution is part of the fun, so I usually don't add explanation here not to ruin that deduction exercise. Though, I'd be happy to explain/discuss it if someone asks. Is that ok? Michael, what do you think?
Hey Kostia,
nice solution. Think I never used
reduceRight
in real life.Sure, you can do that!