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.
Oh, I think that the description is misleading. It says that "The occurence of two or more equal words next after each other count as one.", which I think that means that "dog dog dog dog" should count as 1, although the title of the kata is not consistent with that. Anyway, I've realized that my solution has the same issue :_)
Yes, when we encounter the second pair, we start from scratch because the i counter is pointing to the third element. We can't ever process just one half of a pair, either is a pair and we consum those positions or it isn't.
PD: I've tested it, just to be sure :)
Would this work with 4 consecutives appearances of a word?