Sliding Window Maximum
viaLeetCode
Given an array nums and a sliding window of size k moving from the left to the right of the array, return the maximum value in each window position. Aim for an O(n) solution using a deque.
asked …
Given an array nums and a sliding window of size k moving from the left to the right of the array, return the maximum value in each window position. Aim for an O(n) solution using a deque.