Ad
  • Custom User Avatar

    I know, but if mutation was possible no, you can't.

  • Custom User Avatar

    Ehm, Chrono .. you can work back from expected to get the input.

  • Custom User Avatar

    When that happens, check you don't have an infinite loop. Or your code is not performant enough.

    k can go up to about 10,000,000,000

  • Default User Avatar

    Hello,
    I used a "for loop" or "while loop" in this kata. All test passed. But I can't submit my solution because it exceeds 12000 ms.
    Someone can give me a hint to improve :)

  • Custom User Avatar

    Definitely, 692 was duplicated in the input list, and also the median, so it should a middle element in the output, as well as reflected on both sides of the middle element, just like Chrono79 stated.

  • Default User Avatar

    Oh! Two repeated numbers so both of them will be removed in the processed arr. I've changed my solution in the while loop and it worked fine now.
    Thanks David for the help! Nice kata to practice on :)

  • Custom User Avatar

    Without the input value it is hard to say, it could appear twice in the input (and because one of them was the middle value, only the other one got reflected) or maybe you've mutated it. After seeing the tests, it seems you would get an error message in that case, so it seems it's the first option.

  • Default User Avatar

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