Problem 239 · Hard

Sliding Window Maximum

Monotonic deque stores indices in decreasing value order; dequeue expired and smaller elements per step.

Open the interactive visualisation