Ad
  • Default User Avatar

    It is bad practice to change the input or change a copy of the input.

  • Custom User Avatar

    I met exactly same issue as cazyw, then I figured out this was because I changed strarr using shift method, then I updated my solution without changing it all test passed, although this should be test case issue.

  • Default User Avatar

    Once again I tried some solutions and had no problem.

  • Default User Avatar

    I have the same problem as cazyw, solving in Ruby. In my code I added some debugging output:

    strarr length is: 146
    k is 44
    ✘ Expected: "", instead got: [verylongstring]

    All of the other tests are passing, and it seems like this test should not be expecting ""

  • Custom User Avatar

    78 guys passed the kata in Ruby, I just tried and got no problem. I can't understand what happens with your case.
    Are you sure that k = 64 and not -64? With k = 64 and your array of length 132 your answer is the good one:-)
    In the random tests (I printed k and strarr.length) the only cases with return "" are when k <= 0. Please keep me informed.

  • Custom User Avatar

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

  • Custom User Avatar

    I forgot to ask: which language? Reread the description and see in which cases the result is "". The two cases you gave are almost the same, no? But in the first case your result is "" (I think k is 69, not -69) and in the second a very big string, that seems weird.

  • Custom User Avatar

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

  • Custom User Avatar

    Please fixed tests or random tests? Which input do you have?

  • Custom User Avatar

    Hello, I'm stumped. I'm coding in ruby and it passess all the tests but when I try to submit it always fails on the last test.
    The fail message is: Expected: "", instead got: ............a very long string........

    But I can't see why it expects "" since the k number is less than the array size but greater than zero.

  • Custom User Avatar

    I'm getting the exact same problem as well. And I can't figure out why.

    Edit: Ended up looking at the solutions - I had overcomplicated my code so there were too many calculations being made when the answer was much simpler.