跳到主要内容

Array Sliding Window(数组滑动窗口)

a. 固定长度窗口题目

题号标题题解难度
1343Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold(大小为 K 且平均值大于等于阈值的子数组数目)Python中等
0643Maximum Average Subarray I(子数组最大平均数 I)Python简单
1052Grumpy Bookstore Owner(爱生气的书店老板)Python中等
1423Maximum Points You Can Obtain from Cards(可获得的最大点数)Python中等
1456Maximum Number of Vowels in a Substring of Given Length(定长子串中元音的最大数目)Python中等
0567Permutation in String(字符串的排列)Python中等
1100Find K-Length Substrings With No Repeated Characters(长度为 K 的无重复字符子串)Python中等
1151Minimum Swaps to Group All 1's Together(最少交换次数来组合所有的 1)Python中等
1176Diet Plan Performance(健身计划评估)Python简单
0438Find All Anagrams in a String(找到字符串中所有字母异位词)Python中等
0995Minimum Number of K Consecutive Bit Flips(K 连续位的最小翻转次数)Python困难
0683K Empty Slots(K 个关闭的灯泡)Python困难
0220Contains Duplicate III(存在重复元素 III)Python困难
0239Sliding Window Maximum(滑动窗口最大值)Python困难
0480Sliding Window Median(滑动窗口中位数)Python困难

b. 不定长度窗口题目

题号标题题解难度
0674Longest Continuous Increasing Subsequence(最长连续递增序列)Python简单
0485Max Consecutive Ones(最大连续 1 的个数)Python简单
0487Max Consecutive Ones II(最大连续1的个数 II)Python中等
0076Minimum Window Substring(最小覆盖子串)Python困难
0718Maximum Length of Repeated Subarray(最长重复子数组)Python中等
0209Minimum Size Subarray Sum(长度最小的子数组)Python中等
1004Max Consecutive Ones III(最大连续1的个数 III)Python中等
1658Minimum Operations to Reduce X to Zero(将 x 减到 0 的最小操作数)Python中等
0424Longest Repeating Character Replacement(替换后的最长重复字符)Python中等
0003Longest Substring Without Repeating Characters(无重复字符的最长子串)Python中等
1695Maximum Erasure Value(删除子数组的最大得分)Python中等
1208Get Equal Substrings Within Budget(尽可能使字符串相等)Python中等
1493Longest Subarray of 1's After Deleting One Element(删掉一个元素以后全为 1 的最长子数组)Python中等
0727Minimum Window Subsequence(最小窗口子序列)Python困难
0159Longest Substring with At Most Two Distinct Characters(至多包含两个不同字符的最长子串)Python中等
0340Longest Substring with At Most K Distinct Characters(至多包含 K 个不同字符的最长子串)Python中等
0795Number of Subarrays with Bounded Maximum(区间子数组个数)Python中等
0992Subarrays with K Different Integers(K 个不同整数的子数组)Python困难
0713Subarray Product Less Than K(乘积小于 K 的子数组)Python中等
0904Fruit Into Baskets(水果成篮)Python中等
1358Number of Substrings Containing All Three Characters(包含所有三种字符的子字符串数目)Python中等
0467Unique Substrings in Wraparound String(环绕字符串中唯一的子字符串)Python中等
1438Longest Continuous Subarray with Absolute Diff Less Than or Equal to Limit(绝对差不超过限制的最长连续子数组)Python中等