Given an integer array and a window size k, return the maximum value in every contiguous window of size k.
Process the array efficiently without scanning every window from scratch.
Inputnums = [1, 3, -1, -3, 5, 3, 6, 7], k = 3
Output[3, 3, 5, 5, 6, 7]
The first two windows, [1, 3, -1] and [3, -1, -3], both have maximum 3. The next four windows have maxima 5, 5, 6, and 7.
Inputnums = [1], k = 1
Output[1]
The only window contains 1 by itself, so its maximum is 1.
1 ≤ k ≤ nums.length ≤ 100,000-10,000 ≤ nums[i] ≤ 10,000