Sliding Window | LeetCode Problems

91 Sliding Window solutions to LeetCode solutions.

Sliding Window Problems View all solutions →

Longest Substring Without Repeating Characters

#3 Medium

Substring with Concatenation of All Words

#30 Hard

Minimum Window Substring

#76 Hard

Longest Substring with At Most Two Distinct Characters

#159 Medium

Repeated DNA Sequences

#187 Medium

Minimum Size Subarray Sum

#209 Medium

Contains Duplicate II

#219 Easy

Contains Duplicate III

#220 Hard

Sliding Window Maximum

#239 Hard

Longest Substring with At Least K Repeating Characters

#395 Medium

Arithmetic Slices

#413 Medium

Longest Repeating Character Replacement

#424 Medium

Find All Anagrams in a String

#438 Medium

Sliding Window Median

#480 Hard

Permutation in String

#567 Medium

Longest Harmonious Subsequence

#594 Easy

Smallest Range Covering Elements from K Lists

#632 Hard

Maximum Average Subarray I

#643 Easy

Find K Closest Elements

#658 Medium

Maximum Sum of 3 Non-Overlapping Subarrays

#689 Hard

Subarray Product Less Than K

#713 Medium

Maximum Length of Repeated Subarray

#718 Medium

New 21 Game

#837 Medium

Shortest Subarray with Sum at Least K

#862 Hard

Fruit Into Baskets

#904 Medium

Binary Subarrays With Sum

#930 Medium

Longest Turbulent Subarray

#978 Medium

Subarrays with K Different Integers

#992 Hard

Minimum Number of K Consecutive Bit Flips

#995 Hard

Max Consecutive Ones III

#1004 Medium

Maximum Sum of Two Non-Overlapping Subarrays

#1031 Medium

Longest Duplicate Substring

#1044 Hard

Grumpy Bookstore Owner

#1052 Medium

Swap For Longest Repeated Character Substring

#1156 Medium

Get Equal Substrings Within Budget

#1208 Medium

Replace the Substring for Balanced String

#1234 Medium

Count Number of Nice Subarrays

#1248 Medium

Maximum Number of Occurrences of a Substring

#1297 Medium

Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold

#1343 Medium

Number of Substrings Containing All Three Characters

#1358 Medium

Maximum Points You Can Obtain from Cards

#1423 Medium

Constrained Subsequence Sum

#1425 Hard

Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit

#1438 Medium

Maximum Number of Vowels in a Substring of Given Length

#1456 Medium

Find Two Non-overlapping Sub-arrays Each With Target Sum

#1477 Medium

Longest Subarray of 1's After Deleting One Element

#1493 Medium

Max Value of Equation

#1499 Hard

Maximum Number of Visible Points

#1610 Hard

Defuse the Bomb

#1652 Easy

Minimum Operations to Reduce X to Zero

#1658 Medium

Maximum Erasure Value

#1695 Medium

Minimum Adjacent Swaps for K Consecutive Ones

#1703 Hard

Longest Nice Substring

#1763 Easy

Frequency of the Most Frequent Element

#1838 Medium

Longest Substring Of All Vowels in Order

#1839 Medium

Jump Game VII

#1871 Medium

Substrings of Size Three with Distinct Characters

#1876 Easy

Minimum Number of Flips to Make the Binary String Alternating

#1888 Medium

Minimum Difference Between Highest and Lowest of K Scores

#1984 Easy

Minimum Number of Operations to Make Array Continuous

#2009 Hard

Maximize the Confusion of an Exam

#2024 Medium

K Radius Subarray Averages

#2090 Medium

Maximum Fruits Harvested After at Most K Steps

#2106 Hard

Minimum Swaps to Group All 1's Together II

#2134 Medium

Find Substring With Given Hash Value

#2156 Hard

Minimum Consecutive Cards to Pick Up

#2260 Medium

Find the K-Beauty of a Number

#2269 Easy

Maximum White Tiles Covered by a Carpet

#2271 Medium

Count Subarrays With Score Less Than K

#2302 Hard

Minimum Recolors to Get K Consecutive Black Blocks

#2379 Easy

Longest Nice Subarray

#2401 Medium

Smallest Subarrays With Maximum Bitwise OR

#2411 Medium

Count Subarrays With Fixed Bounds

#2444 Hard

Maximum Sum of Distinct Subarrays With Length K

#2461 Medium

Take K of Each Character From Left and Right

#2516 Medium

Count the Number of Good Subarrays

#2537 Medium

Maximum Beauty of an Array After Applying Operation

#2779 Medium

Count Complete Subarrays in an Array

#2799 Medium

Maximum Sum of Almost Unique Subarray

#2841 Medium

Shortest and Lexicographically Smallest Beautiful String

#2904 Medium

Maximum Strong Pair XOR I

#2932 Easy

Length of Longest Subarray With at Most K Frequency

#2958 Medium

Count Subarrays Where Max Element Appears at Least K Times

#2962 Medium

Find Longest Special Substring That Occurs Thrice I

#2981 Medium

Maximum Length Substring With Two Occurrences

#3090 Easy

Shortest Subarray With OR at Least K I

#3095 Easy

Shortest Subarray With OR at Least K II

#3097 Medium

Minimum Operations to Make Binary Array Elements Equal to One I

#3191 Medium

Alternating Groups II

#3208 Medium

Count of Substrings Containing Every Vowel and K Consonants II

#3306 Medium

Maximum Difference Between Even and Odd Frequency II

#3445 Hard