```
def maxSlidingWindow(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
if nums==None or len(nums)==0:
return []
l,r=0,k
while r<=len(nums):
maxN=max(nums[l:r])
nums[l]=maxN
l+=1
r=l+k
return nums[0:l]
```