Problem 2905 · Medium

Find Indices With Index and Value Difference II

Track the index of the minimum and maximum seen at least indexDifference positions back, then test each new index against both.

Open the interactive visualisation