题解 | #滑动窗口的最大值#
滑动窗口的最大值
https://www.nowcoder.com/practice/1624bc35a45c42c0bc17d17fa0cba788
class Solution: def maxInWindows(self , num: List[int], size: int) -> List[int]: try: res = [] n = len(num) for i in range(n-size+1): res.append(max(num[i:i+size])) return res except: return []