DSA question set · 150 questions
Sliding Window DSA Practice Questions
Explore 150 DSA questions in Sliding Window. Practice with DSAWiser’s code editor and visualizer.
Sliding WindowMathArraysStringsHash TableSortingTwo PointersPrefix SumQueueGreedyMonotonic QueueDivide and ConquerHeapDynamic ProgrammingBit ManipulationFenwick Tree
What’s in this set
The Sliding Window collection contains 150 problems: 50 basic, 50 easy, 30 medium, 20 hard. Choose a question at your current level, or follow the collection’s order below.
Topics in this collection include Sliding Window, Math, Arrays, Strings, Hash Table. Each question shows its own topics and difficulty so you can decide where to begin.
Practice with the code visualizer
- Open a question in the editor and read the statement, inputs, and expected output. Predict the result for a small example before writing code.
- Write a solution and run the examples. If a result differs from your prediction, reduce the input until you can follow each step.
- Step through your code in the visualizer. Use a breakpoint to inspect the state at a specific line, then compare it with your reasoning.
Questions in this set
150 totalOpen a question in the editor to read its statement and examples. Sign in to practice.
- Count Total Windows of Size KSliding Window · MathBasic
- First Window of Size KSliding Window · ArraysBasic
- Last Window of Size KSliding Window · ArraysBasic
- All Window Boundary IndicesSliding Window · ArraysBasic
- Outgoing and Incoming Elements on SlideSliding Window · ArraysBasic
- Single Step Window Sum TransitionSliding Window · MathBasic
- Second Window Sum from First WindowSliding Window · ArraysBasic
- Sum of Every Adjacent PairSliding Window · ArraysBasic
- Sum of Every TripletSliding Window · ArraysBasic
- Sum of All Fixed Windows of Size KSliding Window · ArraysBasic
- Maximum Sum of Window of Size 2Sliding Window · ArraysBasic
- Minimum Sum of Window of Size 2Sliding Window · ArraysBasic
- Maximum Sum of Window of Size KSliding Window · ArraysBasic
- Minimum Sum of Window of Size KSliding Window · ArraysBasic
- Average of Each Window of Size KSliding Window · ArraysBasic
- Count Windows with Sum Greater Than TargetSliding Window · ArraysBasic
- Count Windows of Size K with Even SumSliding Window · ArraysBasic
- Check If Any Window of Size K Sums to TargetSliding Window · ArraysBasic
- Count Windows Containing at Least One ZeroSliding Window · ArraysBasic
- Count Windows Where All Elements Are PositiveSliding Window · ArraysBasic
- All Substrings of Length KSliding Window · StringsBasic
- Count Vowels in First Window of Size KSliding Window · StringsBasic
- Count Vowels in Every Window of Size KSliding Window · StringsBasic
- Maximum Vowels in Any Substring of Length KSliding Window · StringsBasic
- Count Windows Starting and Ending with the Same CharacterSliding Window · StringsBasic
- Absolute Difference Between Window EndsSliding Window · ArraysBasic
- Windows of Size 3 with Strictly Increasing OrderSliding Window · ArraysBasic
- Windows of Size 3 Where Middle Element Is PeakSliding Window · ArraysBasic
- Maximum Element in Windows of Size 2Sliding Window · ArraysBasic
- Range in Windows of Size 2Sliding Window · ArraysBasic
- Product of Every Window of Size 2Sliding Window · ArraysBasic
- Count Odd Numbers in Each Window of Size KSliding Window · ArraysBasic
- Count Windows with Exactly One Negative NumberSliding Window · ArraysBasic
- Count Windows of Size 3 with Sum Equal to ZeroSliding Window · ArraysBasic
- Alternating Parity Windows of Size 2Sliding Window · ArraysBasic
- Compare Sum of First Window and Last WindowSliding Window · ArraysBasic
- Largest Difference Between Consecutive Window SumsSliding Window · ArraysBasic
- First Window to Reach Target SumSliding Window · ArraysBasic
- Index of Window with Maximum SumSliding Window · ArraysBasic
- Count Windows Whose Sum Equals TargetSliding Window · ArraysBasic
- Count Windows of Size 2 with Identical ElementsSliding Window · ArraysBasic
- Count Windows Containing a Specific Target CharacterSliding Window · StringsBasic
- Count Windows with at Least Half Even NumbersSliding Window · ArraysBasic
- Binary String Windows with All OnesSliding Window · StringsBasic
- Number of Zeros in Each Binary WindowSliding Window · ArraysBasic
- Sliding Window Step DifferencesSliding Window · ArraysBasic
- Count Windows Where First Element Equals Last ElementSliding Window · ArraysBasic
- Count Windows of Size 2 with Positive ProductSliding Window · ArraysBasic
- First Window with All Elements Greater Than XSliding Window · ArraysBasic
- Parity of Each Window SumSliding Window · ArraysBasic
- Maximum Average Subarray of Size KSliding Window · ArraysEasy
- Minimum Average Subarray of Size KSliding Window · ArraysEasy
- Count Windows of Size K with Average at Least ThresholdSliding Window · ArraysEasy
- Diet Plan PerformanceSliding Window · ArraysEasy
- Minimum Recolors to Get K Consecutive Black BlocksSliding Window · StringsEasy
- Substrings of Size Three with Distinct CharactersSliding Window · Strings · Hash TableEasy
- Maximum Points You Can Obtain from CardsSliding Window · ArraysEasy
- Minimum Swaps to Group All 1's TogetherSliding Window · ArraysEasy
- Count Occurrences of AnagramsSliding Window · Strings · Hash TableEasy
- Find All Anagram Starting Indices for a 3-Letter PatternSliding Window · Strings · Hash TableEasy
- Defuse the Bomb — Forward WindowSliding Window · ArraysEasy
- Defuse the Bomb — Backward WindowSliding Window · ArraysEasy
- Maximum Circular Subarray Sum of Fixed Size KSliding Window · ArraysEasy
- Minimum Swaps to Group All 1's in a Circular Binary ArraySliding Window · ArraysEasy
- Consecutive Ones in a Circular Binary Array of Fixed Size KSliding Window · ArraysEasy
- Grumpy Bookstore OwnerSliding Window · ArraysEasy
- Maximum Span in Windows of Size ThreeSliding Window · ArraysEasy
- Maximum Sum of Window with No Adjacent DuplicatesSliding Window · ArraysEasy
- Maximum Elements Below Cap in Window of Size KSliding Window · ArraysEasy
- Best Fixed Holding Period ProfitSliding Window · ArraysEasy
- Count Windows of Size K Divisible by MSliding Window · ArraysEasy
- Longest Run of Satisfied Fixed WindowsSliding Window · ArraysEasy
- Count Alternating Binary Substrings of Length KSliding Window · StringsEasy
- Check If All Windows Have Positive SumSliding Window · ArraysEasy
- First Negative Number in Every Window of Size KSliding Window · ArraysEasy
- Smallest Subarray with Sum at Least TargetSliding Window · ArraysEasy
- Longest Subarray with Sum at Most TargetSliding Window · ArraysEasy
- Count Subarrays with Sum Less Than TargetSliding Window · ArraysEasy
- Maximum Consecutive Ones with At Most One FlipSliding Window · ArraysEasy
- Longest Continuous Segment of OnesSliding Window · ArraysEasy
- Subarray Product Less Than KSliding Window · ArraysEasy
- Longest Contiguous Segment of Identical ElementsSliding Window · ArraysEasy
- Shortest Subsegment Containing Both 0 and 1Sliding Window · ArraysEasy
- Longest Subarray of 1's After Deleting One ElementSliding Window · ArraysEasy
- Count Subarrays with At Most K Odd NumbersSliding Window · ArraysEasy
- Substrings of Length K with at Least Two Distinct VowelsSliding Window · StringsEasy
- Longest Homogeneous SubstringSliding Window · StringsEasy
- Shortest Subarray Containing M Occurrences of XSliding Window · ArraysEasy
- Count Substrings with All Three CharactersSliding Window · Strings · Hash TableEasy
- Longest Subarray with Max Difference at Most 1Sliding Window · ArraysEasy
- Maximum Sum of Two Non-Overlapping Windows of Size KSliding Window · ArraysEasy
- Find K-Beauty of a NumberSliding Window · Math · StringsEasy
- Substrings of Length K with Exactly K-1 Distinct CharactersSliding Window · Strings · Hash TableEasy
- Frequency of Target Element in Every Window of Size KSliding Window · ArraysEasy
- Maximum Score After Splitting a StringSliding Window · StringsEasy
- Fruit Into BasketsSliding Window · Arrays · Hash TableEasy
- Get Equal Substrings Within BudgetSliding Window · StringsEasy
- Max Consecutive Ones IIISliding Window · ArraysEasy
- Count Binary Subarrays with At Most K OnesSliding Window · ArraysEasy
- Minimum Difference Between Highest and Lowest of K ScoresSliding Window · Arrays · SortingEasy
- Longest Substring Without Repeating CharactersSliding Window · Strings · Hash TableMedium
- Longest Substring with At Most K Distinct CharactersSliding Window · Strings · Hash TableMedium
- Longest Repeating Character ReplacementSliding Window · Strings · Hash TableMedium
- Permutation in StringSliding Window · Strings · Hash Table · Two PointersMedium
- Find All Anagrams in a StringSliding Window · Strings · Hash TableMedium
- Binary Subarrays With SumSliding Window · Arrays · Prefix SumMedium
- Count Number of Nice SubarraysSliding Window · Arrays · Prefix SumMedium
- Subarrays with K Different IntegersSliding Window · Arrays · Hash TableMedium
- Continuous Subarrays with Difference at Most TwoSliding Window · Arrays · QueueMedium
- Count Substrings with Exactly K Distinct VowelsSliding Window · Strings · Hash TableMedium
- Maximum Erasure ValueSliding Window · Arrays · Hash TableMedium
- Maximum Sum of Distinct Subarrays with Length KSliding Window · Arrays · Hash TableMedium
- Minimum Operations to Reduce X to ZeroSliding Window · Arrays · Prefix SumMedium
- Take K of Each Character From Left and RightSliding Window · Strings · Hash TableMedium
- Replace the Substring for Balanced StringSliding Window · Strings · Hash TableMedium
- Frequency of the Most Frequent ElementSliding Window · Arrays · SortingMedium
- Maximum Beauty of an Array After OperationSliding Window · Arrays · SortingMedium
- Maximum Points Covered within Fixed AngleSliding Window · Arrays · MathMedium
- Longest Subarray with Absolute Difference At Most LimitSliding Window · Arrays · QueueMedium
- Minimum Changes to Make Array ContinuousSliding Window · Arrays · SortingMedium
- Longest Semi-Repetitive SubstringSliding Window · StringsMedium
- Longest Subarray with At Most Two Occurrences of Each ElementSliding Window · Arrays · Hash TableMedium
- Maximum White Tiles Covered by a CarpetSliding Window · Arrays · SortingMedium
- Sliding Subarray BeautySliding Window · Arrays · Hash TableMedium
- Maximum Free Time After Rescheduling Consecutive MeetingsSliding Window · Arrays · GreedyMedium
- Minimum Window Covering All Unique ValuesSliding Window · Arrays · Hash TableMedium
- Count Subarrays Where Max Element Appears At Least K TimesSliding Window · ArraysMedium
- Smallest Range Covering Elements from All ListsSliding Window · Arrays · Hash TableMedium
- Count Complete Subarrays in an ArraySliding Window · Arrays · Hash TableMedium
- Length of Longest Subarray With At Most K FrequencySliding Window · Arrays · Hash TableMedium
- Minimum Window SubstringSliding Window · Strings · Hash TableHard
- Sliding Window MaximumSliding Window · Arrays · Queue · Monotonic QueueHard
- Substring with Concatenation of All WordsSliding Window · Strings · Hash TableHard
- Longest Substring with At Least K Repeating CharactersSliding Window · Strings · Divide and ConquerHard
- Sliding Window MedianSliding Window · Arrays · HeapHard
- Shortest Subarray with Sum at Least KSliding Window · Arrays · Queue · Monotonic QueueHard
- Maximum Number of Robots Within BudgetSliding Window · Arrays · Queue · Monotonic QueueHard
- Constrained Subsequence SumSliding Window · Arrays · Dynamic Programming · QueueHard
- Maximum Sum of Three Non-Overlapping SubarraysSliding Window · Arrays · Dynamic ProgrammingHard
- Minimum Window SubsequenceSliding Window · Strings · Dynamic Programming · Two PointersHard
- Shortest Subarray with Bitwise OR at Least KSliding Window · Arrays · Bit ManipulationHard
- Maximum Fruits Harvested After at Most K StepsSliding Window · Arrays · Prefix SumHard
- Count Subarrays With Fixed BoundsSliding Window · Arrays · QueueHard
- Count Unique Characters of All SubstringsSliding Window · Strings · Hash TableHard
- Shortest Subarray with at Least K InversionsSliding Window · Arrays · Fenwick TreeHard
- Max Value of Equation with Sliding Coordinate WindowSliding Window · Arrays · Queue · Monotonic QueueHard
- Longest Substring Where All Present Characters Have Equal FrequencySliding Window · Strings · Hash TableHard
- Minimum Cost to Make Elements in Window of Size K EqualSliding Window · Arrays · HeapHard
- Shortest Subarray with Bitwise AND At Most KSliding Window · Arrays · Bit ManipulationHard
- Maximum Frequency in Every Window of Size KSliding Window · Arrays · Hash TableHard