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.
I learnt from other solutions that there's no need for the occurrences variable here. Also, the best scored example for this kata used a nice feature of the index method which is to pass a second parameter representing the start index for finding the number.