Problem 719 · Hard

Find K-th Smallest Pair Distance

Binary search the distance; count pairs within it using a sliding window over the sorted values.

Open the interactive visualisation