Concept Flow - Sliding Window Maximum Using Deque
Start with empty deque
For each element in array
Remove indices from front if out of window
Remove indices from back if current element is greater
Add current index to back
If window is formed, record max from front
Repeat until end of array
We keep indexes of useful elements in a deque. Remove out-of-window and smaller elements to keep max at front.
