Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
I don't think I've ever made a sexual moan upon seeing code until today, but this did it.
Ok where's my facepalm emoji?
My humungous for loop...
This comment is hidden because it contains spoiler information about the solution
if u are Solving this kata with js u can use join('+')
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Wow, so concise. Thanks for the learnings.
Brilliant!
A thing of beauty.
Thanks NikCSharp, went with an if statement. The other solutions blew me away afterward too!
You can try either removing the plus after everything is done, which in this case, it looks like the best solution is .replace()(since JS' trimEnd function doesn't allow you to choose the characters being trimmed) or you could prevent the plus from being added in the first place, which could probably be done with a simple if statement.
Expected: '9000000', instead got: '9000000 + '
I am struggling to drop the last '+' in cases where it is not required. Any hints?