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.
Have you tried a "array = array.slice()" as first line (directly before your for-loop)?
You're not meant to modify the original array. It's bad practise to modify it because it will change it permenantly and you can't reverse the process.
Please look at the kata before you write a comment for a bug.
The kata has been solved 1436 times! So I think there is no problem.
Check your code again.
And do not forget this sentence from the description: "The input array should not be modified!"