Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
If you're still stuck, post your code (put a line of three backticks ``` before and after) and mark it as "having spoiler content".
As much as I appreciate reading an algorithm in English, it might be easier to see your problems in JavaScript.
Id assume we are looking at the last index value, so 7's index of 4 is before the second 5's index of 5
How does [5,5] ends earlier than [3,7] ?
Tiebreaking considers the entire pair, so you need to look at the end instead. [5,5] ends earlier than [3,7].