Given an array nums and a window size , return the maximum value in each sliding window as it moves from left to right.
Example: For [1,3,-1,-3,5,3,6,7] and , output is [3,3,5,5,6,7]. The naive approach is too slow.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Given an array nums and a window size , return the maximum value in each sliding window as it moves from left to right.
Example: For [1,3,-1,-3,5,3,6,7] and , output is [3,3,5,5,6,7]. The naive approach is too slow.