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 agree, my initial code was written to remove the longest sequence of the predicate regardless of where it was in the sequence, not if it was just at the start.
Example, if you have [2,5,6,7,5,9,8,9], and the predicate is odd numbers, my reading of the problem is that I look for the longest sequence of odd numbers ( [7,5,9] ), and remove it, returning [2,5,6,8,9].
However, the kata tests that you remove the number of predicate only as they occur at the start of the Array..
So, since this sequence starts with even, you would leave the array untouched and return [2,5,6,7,5,9,8,9].
I am assuming I misunderstand the meaning of "longest prefix" as well.
The confusion I think comes in when he calls for the "longest" prefix... but if prefix is only the inital numbers at the start, you will never have a longer and a shorter prefix... you can only have one prefix to be removed. When I read longest, I instantly went looking fot the longest continuous number of predicate values to remove.