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.
thank you for your advise, it helped a lot!
Now I understand what was wrong with the code, thanks a lot again
Have you tried a "array = array.slice()" as first line (directly before your for-loop)?
if input array is not changed I get the same error
From my point of view, if my script works in a console ,it should work on the site. 1436 other people used some other approach which should not mean that my approach ( again, working properly in console) is a bad one or something
I will try something different
but
Not cool attitude, sir :/
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!"
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution