LeetCodechevron_rightCategorieschevron_rightsliding window
view_carousel

sliding window

133 problems
Easy: 18Medium: 78Hard: 37

sliding window is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

Problem bank

sliding window problem bank

Start with a compact scan-friendly list and progressively load more so the topic page stays readable even when the corpus is large.

Progressive topic library

Built for large topic sets: scan the structure first, then go deeper.

hourglass_bottomScroll to continue
search
tuneDifficulty

Showing 24 / 133 problems

+24 per load
#TitleDifficulty
3

Longest Substring Without Repeating Characters

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

Medium
30

Substring with Concatenation of All Words

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

Hard
76

Minimum Window Substring

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

Hard
187

Repeated DNA Sequences

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

Medium
209

Minimum Size Subarray Sum

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

Medium
219

Contains Duplicate II

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

Easy
220

Contains Duplicate III

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

Hard
239

Sliding Window Maximum

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

Hard
395

Longest Substring with At Least K Repeating Characters

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

Medium
413

Arithmetic Slices

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

Medium
424

Longest Repeating Character Replacement

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

Medium
438

Find All Anagrams in a String

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

Medium
480

Sliding Window Median

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

Hard
567

Permutation in String

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

Medium
594

Longest Harmonious Subsequence

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

Easy
632

Smallest Range Covering Elements from K Lists

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

Hard
643

Maximum Average Subarray I

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

Easy
658

Find K Closest Elements

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

Medium
689

Maximum Sum of 3 Non-Overlapping Subarrays

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

Hard
713

Subarray Product Less Than K

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

Medium
718

Maximum Length of Repeated Subarray

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

Medium
837

New 21 Game

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

Medium
862

Shortest Subarray with Sum at Least K

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

Hard
904

Fruit Into Baskets

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

Medium

swap_vertScroll inside the bank to auto-load more

Related Patterns

Sliding Window LeetCode Problems: 133 Solutions