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.
Wouldn't this re-run arr.filter(e => e === 1).length for every iteration?
Edit - not sure what's going on there, but you shouldn't have to make sure that the array is all the same. I just use localCompare.
This was more challening than I thought at first.
One thing I don't understand: Why does the original array have to be shallow copied to preserve the order of items that have equal last characters?
OK, I assume it was just a random glitch.
I managed to pass it after "attempting" several times.
In Java, there are rounding errors with some of the random tests. They're off by one in some cases.