Ad
  • Default User Avatar

    thank you for your advise, it helped a lot!
    Now I understand what was wrong with the code, thanks a lot again

  • Default User Avatar

    Have you tried a "array = array.slice()" as first line (directly before your for-loop)?

  • Default User Avatar

    if input array is not changed I get the same error
    From my point of view, if my script works in a console ,it should work on the site. 1436 other people used some other approach which should not mean that my approach ( again, working properly in console) is a bad one or something
    I will try something different
    but
    Not cool attitude, sir :/

  • Custom User Avatar

    You're not meant to modify the original array. It's bad practise to modify it because it will change it permenantly and you can't reverse the process.

  • Default User Avatar

    Please look at the kata before you write a comment for a bug.
    The kata has been solved 1436 times! So I think there is no problem.

    Check your code again.

    And do not forget this sentence from the description: "The input array should not be modified!"

  • Default User Avatar

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

  • Default User Avatar

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