Concept Flow - Sliding Window Maximum Using Deque
Start
Initialize empty deque
For each element in array
Remove indices out of window from front
Remove smaller elements from back
Add current index to back
If window formed, record max from front
Repeat until end
Return max list
End
The deque keeps indexes of useful elements in current window. Front always has max. Remove out-of-window and smaller elements before adding new.
