Maintain a monotonic deque of indices whose values are in decreasing order.
For each index i:
i.The deque always contains only candidates for the maximum, ordered so the max is at the front.
Maintain a monotonic deque of indices whose values are in decreasing order.
For each index i:
i.The deque always contains only candidates for the maximum, ordered so the max is at the front.