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 think its because the question asks for groups of CONSECUTIVE size difference? With a class of one, the only consecutive solution would be [1,0]. While that may be correct in a purely mathematical way, that would not really be dividing the class in any actual groups (which was what was asked for).
I do not quite understand: at which point are you using that "product" import from itertools?
totaly valid solution. Feels a bit like cheating though... X)
Damn, i had the same issue. thanls for clarifying
One test case seems incorrect, given the wording of the instructions:
the test case t = 163, k = 3, ls = [50] is expected to return "None". But according to the instructions it should be "50"
since the guy wants to travel LESS than t miles and visit LESS than k cities and the woman is happy to visit as many cities as possible on her list ( which is one in this case) the correct solution would be to travel to her one and only destination (which is 50 miles away: less than t miles and less than k cities. all that the guy wanted)
or am i wrong? (nice kata anyway, though)
Not really a big problem, but the Kata does not actually specify that shift will not be larger than the length of the alphabet. Most of the accepted solutions would not work if shift was set larger than 26.
Perhaps either more test cases with larger shift values should be given, or a shift-size <= 26 should be specified in tha kata description?
Nice, but I noticed the kata did not actually specify that shift would never be larger than the Alphabet size. Although not present in the test.cases, this solution will not work if shift > 26.
This comment is hidden because it contains spoiler information about the solution
This is no issue with "False" != 0
For the following (random) test:
[0, 0, -9, 'b', True, 6, 'x', 'pippi', 1, -6, -10, 0, -7, 'pippi', 6, -6, 5, 0, -7, 0, 0, 7, 'b', 'y', 4, -5, 0, 'z']
,the only accepted (even though clearly incorrect) solution is:
[-9, 'b', True, 6, 'x', 'pippi', 1, -6, -10, -7, 'pippi', 6, -6, 5, -7, 7, 'b', 'y', 4, -5, 'z']
Which is simply WRONG as it contradicts the Instructions
The correct solution SHOULD be:
[-9, 'b', True, 6, 'x', 'pippi', 1, -6, -10, -7, 'pippi', 6, -6, 5, -7, 7, 'b', 'y', 4, -5, 'z', 0, 0, 0, 0, 0, 0, 0]
, but this is marked as "incorrect" during the random tests.At least in python, this test can only be passed by hardcoding it to give the INCORRECT answer at random tests. Maybe you have been using something different than python, and only the python version is broken?
@CodingBuddah,
I have the same issues as Hendeca in python (any version). It only worked after I hardcoded it to recodgnize the random tests and in those cases give an output that REMOVES the zeroes instead of moving them to the end (contradicting the instructions).
But i DID notice that i can fork accepted solutions and run them without errors in the random tests. No Idea what is wrong there (because my output is definitively accepted as correct if, and only if, i purposely produce "incorrect" output at the random tests).
Here's my solution (Any Idea on what the problem could be)?
The expected solution of the random tests contradict the Instructions.
For example with the following input-array:
[0, 0, -9, 'b', True, 6, 'x', 'pippi', 1, -6, -10, 0, -7, 'pippi', 6, -6, 5, 0, -7, 0, 0, 7, 'b', 'y', 4, -5, 0, 'z']
my solution (wich is marked as incorrect) gives:
[-9, 'b', True, 6, 'x', 'pippi', 1, -6, -10, -7, 'pippi', 6, -6, 5, -7, 7, 'b', 'y', 4, -5, 'z', 0, 0, 0, 0, 0, 0, 0].
But the stated expected solution is given as:
[-9, 'b', True, 6, 'x', 'pippi', 1, -6, -10, -7, 'pippi', 6, -6, 5, -7, 7, 'b', 'y', 4, -5, 'z']
So the expected solution simply REMOVES all zeros, while the instructions clearly state that the zeros should be MOVED TO THE END of the array
How come this doesn't raise an IndexError ("list index out of bounds") in Python, as soon as i reaches len(arr)?
I did not know you could slice arrays with indices larger than the array length...
Thanks for the explanation. I am slowly getting the rough Idea, but I still don't believe I would have ever come to this solution. Great Idea. I'm envious.
It works. You just copied it incorrectly. No need to whine about it
I think this kata could be made more challenging, but also more on topic, by asking for the reverse complement DNA sequence.
(The exact complement is rarely needed anyway due to the standard convention of writing all DNA sequences fom 5'-3'.
So the "complement" should always be written down as the "reverse complement")
Loading more items...