Ad
  • 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.