← 返回 nvidia 的题目列表Sliding Window Maximum in O(n) Time Complexity
类型:online_judge
nvidia
Given an integer array nums and a sliding window size k, find the maximum value in each sliding window and return them as an array. Optimize the solution to achieve O(n) time complexity.
Example
Input
[1,3,-1,-3,5,3,6,7] 3