Problem 2817 · Medium

Minimum Absolute Difference Between Elements With Constraint

Sweep right, keep the values at least x positions behind in a sorted set, and check the nearest neighbours of each value in that set.

Open the interactive visualisation