Select your answers. Once selected, you cannot change them.
Given an array of integers and a window size k
, find the maximum element in every contiguous subarray of size k
.
Input: nums = [1,3,-1,-3,5,3,6,7], k = 3 Output: [3,3,5,5,6,7]
Write your solution below: