Ad
  • Custom User Avatar

    Actually modifying the array is considered bad practice if unnecessary.

    Btw, I upvoted myjinxin2015, as he definitely deserved it.

  • Default User Avatar

    myjinxin2015: even though I think it's not correct approach and evaluation of tests should be independent of the modification to the original array (it still returns correct sum, doesn't it? and why it works with initial tests but not random?) you're right that it helps to pass the random tests. Once I changed code the way it works with copy of original array it works fine.

    Anyway, you are not sensei of this kata and thanks for advice

  • Custom User Avatar

    I just said some advice, if you don't agree you can ignore it.

    But why did I get a downvote? Unhappy :(

  • Custom User Avatar

    please check your code, make sure that you haven't modified the original array ;-)

    And same suggestion to other guys ;-)