Implement `maxSlidingWindow(nums, k)` that returns an array of the maximum value within each contiguous window of size `k` as the window slides left to right. Aim for O(n).
+ 2 hidden tests run on Submit.
A monotonic deque keeps candidate maxima in decreasing order. Smaller trailing values are discarded because a later, larger value dominates them for the rest of their lifetime. Each index enters and leaves the deque once, so the whole pass is O(n).
Run your code to see results.