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.
OP solved it, closing
!
OP solved it,closing
Fixed description.
You can't delete solutions, however CW itself will flags them as failed if they actually do fail when tests are updated.
Not a kata issue.
The reason the kata is 8 kyu is because it was originally a Clojure kata and this is one of the simplest things you can do in Clojure. Subsequent ports are naturally harder in other languages, but the difficulty rating is common across languages. It may make sense now to reclassify it, but I don't think CodeWars lets you do that, unfortunately.
Very true! I have never ran into generators before, and I have been stuck on that part of the problem for a very long time. I agree that this should be bumped to a harder difficulty kyu.
My guess is this is never going to be changed. Also, "longest prefix" is not actually open to interpretation.
Closing this suggestion.
I couldn't agree more!
The numbers do appear to side with the winners you calculated.
You should ask @NateBrady23 to look at his tests, there are seemingly a couple of bad apples in a large barrel.
I am also stuck at same problem.please tell what to do
The arguments are not in the same order in Dog vs Labrador. Are you sure you've got them all covered?
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.
Hi, could you append your attempted solution so I can try to figure out what happened? Thank you!
Loading more items...