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.
Author is long gone, so I am going to unpublish
As mentioned below, the reference solution used in the random tests are incorrect.
This comment is hidden because it contains spoiler information about the solution
Now fixed.
Random tests are producing false negatives:
Folks, I would love to get some feedback on a kata a put together.
https://www.codewars.com/kata/spies-expose-the-dirty-double-crossers
Any thoughts how to improve?
longestPrefix
is awkward, butsuffixes
is g e n i u s !You should read again the description!
But, thence, 16 would be [4, 3, 3, 3, 3] instead of the given [4, 4, 4, 4, 0].
Also, I cannot derive the split [4, 4, 4, 4, 0] given the rules. It breaks the rule 'the fifth part has the longest length'.
I think 6 would be [2,1,1,1,1] and 7 would be [2,2,1,1,1] and 11 would be [3,2,2,2,2] mainly driven by the restriction that the fifth portion be as long as possible but less than or equal to the other 4.
This comment is hidden because it contains spoiler information about the solution
Ah, I misread the instrucions - I read the above ans 0->1->4->0 so a ring of 3!
Glad you enjoyed. I'll be interested to see how people solve it. Can you paste the exact error your are getting from the quick check? In the example mentioned above the ring size would be 1 because no one is spying on each other.
It's showing a test case when it fails - eg [(0,[1]), (4,[0]), (1,[4])] ... 3 /= 1. Intuitively the solution is 3 and if I type the case into the eaxample tests it passes with 3. But I'm always getting a random failure with a spy ring of 3. Perhaps I'm missing something? Just to add, it could well be a problem with my solution - it took me a lot longer to solve than expected which makes it an interesting kata.
Thanks for taking a look at this one. I have updated the test cases so that - I beleive- you will receive a counter examples in case of failure. The random test case code snippet is:
This is my first Kata and I am not an expert on hTest, so I'd welcome improvement suggestions.
Loading more items...