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.
Tried using the unshift method and nothing more
OR is always hard to understand. can you check my one line solution? :)
People seem to hate this answer because it is too verbose? I don't know, it's good to see documented answers too. Not everything has to be a one-liner.
Also, it is the faster solution of the top solutions. Magical, isn't it? More words != less performant.
Clever usage of a simple for loop.
Why reversing the order? I don't see the point. Also moving the whole array every iteration? what is going on?
Probably one of the slowest solutions from the top 10.
My bad, flagged it.
Please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution