Approach hintTry it first, then revealHide
Keep a deque of indices with decreasing values: drop indices that have left the window from the front and smaller values from the back, so the front always holds the window maximum. O(n).
Keep a deque of indices with decreasing values: drop indices that have left the window from the front and smaller values from the back, so the front always holds the window maximum. O(n).