Problem 2616 · Medium
Sort the numbers, binary search the largest allowed pair gap, and count disjoint pairs greedily.
Open the interactive visualisation