Skip to content

Variable-length Sliding Window

Longest/Maximum

  • 3.Longest Substring Without Repeating Characters
  • 3090.Longest Substring with At Most Two Occurrences of Each Character
  • 1493.Longest Subarray of 1's After Deleting One Element
  • 1208.Get Equal Substrings Within Budget
  • 2730.Longest Semi-Repeating Substring
  • 904.Fruit Into Baskets
  • 1695.Maximum Erasure Value
  • 2958.Longest Subarray with at Most K Repeated Elements
  • 2779.Maximum Beauty of an Array After Applying Operation
  • 2024.Maximize the Confusion of an Exam
  • 1004.Max Consecutive Ones III
  • 1658.Minimum Operations to Reduce X to Zero
  • 1838.Frequency of the Most Frequent Element
  • 2516.Take At Least K of Each Character
  • 2831.Longest Equal Value Subarray
  • 2271.Maximum White Tiles Covered by a Carpet
  • 2106.Maximum Fruits Harvested
  • 2555.Maximum Prizes from Two Non-Overlapping Segments
  • 2009.Minimum Operations to Make Array Continuous
  • 1610.Maximum Number of Visible Points
  • 2781.Length of the Longest Valid Substring
  • 2968.Maximum Frequency Score After Operations
  • 1040.Moving Stones Until Consecutive II
  • 395.Longest Substring with At Least K Repeating Characters
  • 1763.Longest Nice Substring
  • 487.Max Consecutive Ones II (Premium)
  • 159.Longest Substring with At Most Two Distinct Characters (Premium)
  • 340.Longest Substring with At Most K Distinct Characters (Premium)

Shortest/Minimum

  • 209.Minimum Size Subarray Sum https://youtu.be/uKXwBRH9kC4
  • 2904.Shortest and Lexicographically Smallest Beautiful Substring
  • 1234.Replace the Substring for Balanced String
  • 2875.Shortest Subarray in Infinite Array
  • 1574.Shortest Subarray to Be Removed to Make Array Sorted
  • 76.Minimum Window Substring
  • 632.Smallest Range Covering Elements from K Lists

Count Subarrays

Longer is Valid

  • 1358.Number of Substrings Containing All Three Characters
  • 2962.Count Subarrays with Maximum Element Appearing at Least K Times
  • 3325.Count Substrings with At Least K Occurrences of Characters I
  • 2799.Count Complete Subarrays in an Array
  • 2537.Count Good Subarrays
  • 3298.Count Substrings After Rearrangement Including Another String II
  • 2495.Count Subarrays with Even Product (Premium)

Shorter is Valid

  • 713.Subarray Product Less Than K
  • 3258.Count Substrings with K Constraints I
  • 2302.Count Subarrays with Sum Less Than K
  • 2762.Uninterrupted Subarrays
  • 3134.Find the Median of Uniqueness Arrays
  • 3261.Count Substrings with K Constraints II
  • 2743.Count Substrings Without Repeating Characters (Premium)

Exact Match Sliding Window

  • 930.Binary Subarrays with Sum
  • 1248.Count Number of Nice Subarrays
  • 3306.Count Vowel-Consonant Strings II
  • 992.Subarrays with K Different Integers

Other (Optional)

  • 1438.Longest Continuous Subarray with Absolute Diff Less Than or Equal to Limit
  • 2401.Longest Nice Subarray
  • 1156.Swap For Longest Repeated Character Substring
  • 424.Longest Repeating Character Replacement
  • 438.Find All Anagrams in a String
  • 1712.Ways to Split Array Into Three Subarrays
  • 1918.K-th Smallest Subarray Sum (Premium)