Ad
  • Custom User Avatar

    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

  • Custom User Avatar

    Problems with performance of tests were cased by a fu broken implementation of shuffle, should be fixed now.

  • Custom User Avatar

    Tried, but in vain.

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    C version of this kata seems broken. getting no feedback from the tests.

  • Custom User Avatar

    A Beautiful Kata. Many possible ways of solving.

  • Custom User Avatar

    i was very surprised how few C solutions actually used #include <regex.h>
    given that it is tagged as a regex kata.

  • Custom User Avatar

    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?

  • Custom User Avatar

    Usually mathematical expressions like this are calculated left to right so it would be 2 * 3 = 6

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Default User Avatar

    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.

  • Custom User Avatar

    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...