Given an integer array and an integer , return the maximum element in each sliding window of size . You're solving the textbook monotonic deque problem.
The solution is because each element is added to and removed from the deque at most once. Read the problem. Constraints are up to elements.