题库chevron_right分类chevron_right滑动窗口
view_carousel

滑动窗口

133 道题目
简单: 18中等: 78困难: 37

滑动窗口 是技术面试里最常出现的能力维度之一。建议先掌握基础题型的边界处理,再逐步过渡到模式识别和复杂度 trade-off。

面试场景

高频考察问题建模、边界条件与口头表达的清晰度。

常见误区

只背模板不解释为什么,容易在追问里失分。

练习策略

每轮练 3-5 题,固定复盘复杂度和可替代解法。

推荐练习顺序

题库

滑动窗口 题库

先展示一段最适合快速浏览的题目列表,继续滚动时再慢慢续载,避免专题页被长列表一下子拉穿。

慢加载专题题库

适合这类题很多的专题,先扫结构,再逐步深入。

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 133 道题目

每次续载 24 题
#题目难度
3

无重复字符的最长子串

Find the length of the longest substring without repeating characters using a sliding window and hash map to track state…

中等
30

串联所有单词的子串

Find all starting indices of substrings in a string that are concatenations of a given list of words.

困难
76

最小覆盖子串

Find the smallest substring of s containing all characters from t using a sliding window with running state updates for …

困难
187

重复的DNA序列

Solve Repeated DNA Sequences by sliding a length-10 window and tracking seen patterns with a hash set or bitmask.

中等
209

长度最小的子数组

Find the minimal length of a subarray whose sum is greater than or equal to the target using efficient algorithms.

中等
219

存在重复元素 II

Check if any two equal numbers exist within k indices using array scanning and hash table lookup efficiently.

简单
220

存在重复元素 III

The problem involves finding a pair of indices in an array where the index and value differences are within given limits…

困难
239

滑动窗口最大值

Solve the "Sliding Window Maximum" problem using efficient techniques like the sliding window, deque, and priority queue…

困难
395

至少有 K 个重复字符的最长子串

Find the length of the longest substring where every character appears at least k times using sliding window and divide-…

中等
413

等差数列划分

Count the number of arithmetic subarrays in a given integer array using dynamic programming.

中等
424

替换后的最长重复字符

Find the length of the longest substring after at most k replacements using a sliding window and character count trackin…

中等
438

找到字符串中所有字母异位词

Find all starting indices of p's anagrams in s using sliding window and hash table approach.

中等
480

滑动窗口中位数

Compute the median for each sliding window of size k in an array using efficient array scanning and hash lookup techniqu…

困难
567

字符串的排列

Check if a string contains a permutation of another string using two-pointer scanning and hash table techniques.

中等
594

最长和谐子序列

Find the length of the longest harmonious subsequence in an integer array using array scanning and hash-based frequency …

简单
632

最小区间

Find the minimal range covering at least one number from each of k sorted lists using array scanning and hash lookup eff…

困难
643

子数组最大平均数 I

Find the maximum average of any contiguous subarray of length k in a given integer array using a sliding window approach…

简单
658

找到 K 个最接近的元素

Identify the k integers closest to a target x in a sorted array using binary search and two-pointer strategies efficient…

中等
689

三个无重叠子数组的最大和

Maximize the sum of three non-overlapping subarrays with length k in an integer array using dynamic programming.

困难
713

乘积小于 K 的子数组

Count subarrays with a product strictly less than a given value k using efficient algorithms like binary search and slid…

中等
718

最长重复子数组

Find the maximum length of a subarray that appears in both given integer arrays using dynamic programming.

中等
837

新 21 点

Calculate the probability Alice reaches at most n points using state transition dynamic programming efficiently.

中等
862

和至少为 K 的最短子数组

Find the shortest subarray with a sum of at least k using binary search and sliding window techniques.

困难
904

水果成篮

The Fruit Into Baskets problem requires finding the maximum number of fruits you can pick from a row of trees under spec…

中等

swap_vert在题库框内继续向下滚动,也会自动续载

关联高频模式

LeetCode 滑动窗口题型题解:133题训练路线