1658. 将 x 减到 0 的最小操作数 https://leetcode.cn/problems/minimum-operations-to-reduce-x-to-zero
1658. Minimum Operations to Reduce X to Zero https://leetcode.com/problems/minimum-operations-to-reduce-x-to-zero
713. 乘积小于K的子数组 https://leetcode.cn/problems/subarray-product-less-than-k
713. Subarray Product Less Than K https://leetcode.com/problems/subarray-product-less-than-k
1004. 最大连续1的个数 III https://leetcode.cn/problems/max-consecutive-ones-iii
1004. Max Consecutive Ones III https://leetcode.com/problems/max-consecutive-ones-iii
340. 至多包含 K 个不同字符的最长子串 https://leetcode.cn/problems/longest-substring-with-at-most-k-distinct-characters
340. Longest Substring with At Most K Distinct Characters https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters
424. 替换后的最长重复字符 https://leetcode.cn/problems/longest-repeating-character-replacement
424. Longest Repeating Character Replacement https://leetcode.com/problems/longest-repeating-character-replacement
219. 存在重复元素 II https://leetcode.cn/problems/contains-duplicate-ii
219. Contains Duplicate II https://leetcode.com/problems/contains-duplicate-ii
220. 存在重复元素 III https://leetcode.cn/problems/contains-duplicate-iii
220. Contains Duplicate III https://leetcode.com/problems/contains-duplicate-iii
209. 长度最小的子数组 https://leetcode.cn/problems/minimum-size-subarray-sum
209. Minimum Size Subarray Sum https://leetcode.com/problems/minimum-size-subarray-sum
395. 至少有 K 个重复字符的最长子串 https://leetcode.cn/problems/longest-substring-with-at-least-k-repeating-characters
395. Longest Substring with At Least K Repeating Characters https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters
Prerequisites
Before reading this article, you need to learn:
The application of the sliding window algorithm is very broad. However, our framework can be applied to all problems that require the sliding window algorithm. Below, I will illustrate some of the most classic problems. I will repeatedly emphasize the thinking process from the Sliding Window Algorithm Framework to strengthen your understanding and memory of this algorithm.