Ad
  • Custom User Avatar

    Maybe, but if that is the case, we should leave the issue open until it can be fixed if not by the author, by a power-user.

  • Custom User Avatar

    I could be wrong, but given the pattern of activity for this user, it looks like another Founders and Coders deal where they'll leave as soon as they've got one published.. author may not be coming back.

  • Custom User Avatar

    See the post below, fix it doing what I suggested there.

  • Custom User Avatar
  • Custom User Avatar

    That would make sense. The only issue is that I still have some tests passing with more than one number input arrays.

    Edit: Ignore this, I copied the array and it works fine.

  • Custom User Avatar

    The reason is your code is mutating the input array, and because the control function uses it afterwards, it gets the wrong expected value.
    @kamilalew get the expected value first or pass a copy to the user's function.

  • Custom User Avatar

    My JavaScript code fails 91 tests. All of these test cases have more than one number and say they were expecting zero. I've gone through some of the smaller ones by hand and the answer from my code seems to be right.

    Edit: Apart from the special cases, surely it's only possible for the answer to be zero if all the numbers in the array are the same.