Given nums and a window size k, return the maximum of every window as it slides from left to right.
nums
k
nums = [1,3,-1,-3,5,3,6,7], k = 3
[3,3,5,5,6,7]
nums = [1], k = 1
[1]
1 <= nums.length <= 10^5 1 <= k <= nums.length -10^4 <= nums[i] <= 10^4
Topics
Implement maxSlidingWindow in the editor and return the answer — printing it is never graded.
maxSlidingWindow
Problem 105 of 1146 in the arena