Ad
  • Custom User Avatar

    The interpretation is actually

    • 1st place has score 1
    • 2nd place - there is no 2nd place, it's a tie for first, with score 1
    • 3rd place has score 2
    • 4th place - there is no 4th place, it's a tie for third, with score 2
    • 5th place - there is no 5th place, it's a tie for third, with score 2
    • 6th place has score 6
  • Custom User Avatar

    My code is also failing on the test with this error, expected: [6,3,3,3,1,1] but got: [6,2,2,2,1,1]

    I might be missing something, but shouldn't

    ranks([-1,3,3,3,5,5]) == [6,2,2,2,1,1]
    

    because 3 is the second largest number?

    I'm coming to this conclusion based on this part of the instructions:

    The largest value has rank 1, the second largest value has rank 2, and so on.
    Ties should be handled by assigning the same rank to all tied values.