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.
This comment is hidden because it contains spoiler information about the solution
I believe you are actually correct. This should have failed some test cases similar to the one you posted. To be fair to myself, I wrote this close to 5 years ago or so. Because of this, I just took another stab at it and this is how I would approach this today. No need to loop:
https://www.codewars.com/kata/reviews/57f615994f267f2f4d0000ea/groups/63923fa39321de00015a762c