Problem 2592 · Medium
Sort the values, then match each candidate against the smallest value it can still beat.
Open the interactive visualisation