Sliding Window Minimum — Solution & Editorial
Monotonic deque of indices with increasing values: pop the back while ≥ the new element, drop the front when it leaves the window; the front is the minimum.
Complexity: O(N)
Monotonic deque of indices with increasing values: pop the back while ≥ the new element, drop the front when it leaves the window; the front is the minimum.
Complexity: O(N)