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.
According to the condition of the problem, the length of the array is guaranteed to be > 1, in the examples it can be seen that the first element in the incoming array is "thrown out", this is logical, because checking for i % 0 will not make sense. That's why we start the sequence with 1
Problems with performance of tests were cased by a
fubroken implementation ofshuffle
, should be fixed now.Tried, but in vain.
nice work !
This comment is hidden because it contains spoiler information about the solution
C version generally works, but tests seem to go over the top a bit and oscillate on the edge of timeout. Your solution has to be quite performant to pass.
I will take a look tomorrow if something can be improved wrt timeouts or tests feedback, but even if amount of tests will be cut in half, solutions with complexity worse than linear will most certainly timeout.
C version of this kata seems broken. getting no feedback from the tests.
A Beautiful Kata. Many possible ways of solving.
i was very surprised how few C solutions actually used #include <regex.h>
given that it is tagged as a regex kata.
Yeah, thanks for mentioning it. It is just a convention though, as far as i know.
As far as i know, it is not something mathematical. So i just like to have it explicit,
because it is just a convention, right?
Usually mathematical expressions like this are calculated left to right so it would be 2 * 3 = 6
This comment is hidden because it contains spoiler information about the solution
nice solution. did not understand all of it, but it is shorter than mine. But you do not have to 0-initialize an array. it is so automatically.
At least in the Javascript version I authored, if something's not valid, e.g. jump to label that doesn't exist, it's expected that an exception be thrown.
for anyone who is parsing the program and then executing:
it basically expects to detect invalid instructions at runtime.
you can solve this by adding a bogus instruction when the parser detects an invalid instruction.
this bogus instruction then can be detected at runtime, throwing a RuntimeException as it is about to execute.
This importance of this is that the Testcases excpect the output up until the invalid instruction is encountered.
Loading more items...