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.
Passing test that run when you hit "test" button is just first step of validation of your code, when you hit "attempt" more complex (often random) test cases are run on your code.
So most likely your code doesn't work well in some edge cases.
I wonder how this solution passed the empty array test without throwing exception?