Problem 2616 · Medium

Minimize the Maximum Difference of Pairs

Sort the numbers, binary search the largest allowed pair gap, and count disjoint pairs greedily.

Open the interactive visualisation