Ad
  • Custom User Avatar

    Hey there Gouldie. The test is correct, the answer is 6. Position 1 isn't a valid answer. I feel like you may not understand the question fully, so I'll break down the reason for you below:


    In position 1:

    [10,-80,10,10,15,35,20] -80 is in position 1. So that means the left side is [10] and the right side is [10,10,15,35,20].
    We add all of these up and get left side = 10 and right side = 90.
    10 is not equal to 90, so it is not a valid answer.


    In position 6:

    [10,-80,10,10,15,35,20] 20 is in position 6. So that means the left side is [10,-80,10,10,15,35] and the right side is [].
    We add all of that up and we get left side = 0 and right side = 0 (We treat empty arrays as 0 in this problem)
    These are equal, so that is the answer.


    If you have any other questions, feel free to ask. However, please remember that the issue button is only for when a kata has a problem. Please use the question button instead when you have a question.

  • Default User Avatar

    Im having trouble with a built in sample test:
    Test.assert_equals(find_even_index([10,-80,10,10,15,35,20]),6)
    why is the solution 6 and not 1?
    while both, I believe, are valid, since 1<6 shouldn't "1" be the corrent solution?