Pattern
Sliding Window
A compact view of archive entries grouped by recurring technique.
51 entries
51 entries tagged as Sliding Window.
19.04.2026
medium1855. Maximum Distance Between a Pair of Values
Max distance a[i] not greater than b[j] window
07.03.2026
medium1888. Minimum Number of Flips to Make the Binary String Alternating
Min flips to make 01 alterating string sum window
23.02.2026
medium1461. Check If a String Contains All Binary Codes of Size K
All numbers as substring length of k window
19.02.2026
easy696. Count Binary Substrings
Count substrings of 01 and 10 window
12.02.2026
medium3713. Longest Balanced Substring I
Max substring with equal frequencies window
06.02.2026
medium3634. Minimum Removals to Balance Array
Min removals to make min k not less than max window
02.02.2026
hard3013. Divide an Array Into Subarrays With Minimum Cost II
Min sum of k splits at max d distance window
25.01.2026
easy1984. Minimum Difference Between Highest and Lowest of K Scores
Min k-diff window
18.12.2025
medium3652. Best Time to Buy and Sell Stock using Strategy
Max Profit by modifying a sliding window sum
15.11.2025
medium3234. Count the Number of Substrings With Dominant Ones
Subarray zeros^2 less than ones window
07.11.2025
hard2528. Maximize the Minimum Powered City
Max min r-range sum after adding total of k window
05.11.2025
hard3321. Find X-Sum of All K-Long Subarrays II
Sums of x most frequent from k-windows
22.10.2025
hard3347. Maximum Frequency of an Element After Performing Operations II
Max frequency after changing +k..-k ops elements window
21.10.2025
medium3346. Maximum Frequency of an Element After Performing Operations I
Max frequency after changing +k..-k ops elements window
28.09.2025
easy976. Largest Perimeter Triangle
Max triangle perimeter from array of lengths window
14.08.2025
easy2264. Largest 3-Same-Digit Number in String
Max 3-digit in string
3.08.2025
hard2106. Maximum Fruits Harvested After at Most K Steps
Max values k steps from start point window
22.07.2025
medium1695. Maximum Erasure Value
Max unique subarray sum window
9.07.2025
medium3439. Reschedule Meetings for Maximum Free Time I
Max free time after moving k events together window
11.06.2025
hard3445. Maximum Difference Between Even and Odd Frequency II
Max odd - min even frequency, window at least k
16.04.2025
medium2537. Count the Number of Good Subarrays
Subarrays with at least k equal pairs window
08.03.2025
easy2379. Minimum Recolors to Get K Consecutive Black Blocks
Min 'W' flips to make k 'B' window
28.12.2024
hard689. Maximum Sum of 3 Non-Overlapping Subarrays
max non-intersecting intervals programming window
14.12.2024
medium2762. Continuous Subarrays
Count subarrays with difference <= 2 queue set
10.12.2024
medium2981. Find Longest Special Substring That Occurs Thrice I
Max same-char 3-windows length window
20.11.2024
medium2516. Take K of Each Character From Left and Right
Min take k of a,b,c from head or tail pointers
19.11.2024
medium2461. Maximum Sum of Distinct Subarrays With Length K
Max k-unique window sum window
18.11.2024
easy1652. Defuse the Bomb
Next +-k window sums window
16.11.2024
medium3254. Find the Power of K-Size Subarrays I
Tops of consecutive increasing windows window
10.11.2024
medium3097. Shortest Subarray With OR at Least K II
Min subarray with OR[..] >= k manipulation window
02.08.2024
medium2134. Minimum Swaps to Group All 1's Together II
Min swaps to make a circular [01] array window
3.07.2024
medium1509. Minimum Difference Between Largest and Smallest Value in Three Moves
Min difference after 3 changes in array window programming
24.06.2024
medium995. Minimum Number of K Consecutive Bit Flips
Count k-range flips in binary array to make all 1 window
23.06.2024
medium1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Longest subarray with abs(a[i] - a[j]) <= limit window queue
22.06.2024
medium1248. Count Number of Nice Subarrays
Count subarrays with k odds window
21.06.2024
medium1052. Grumpy Bookstore Owner
Max customers sum after make consecutive minutes non-grumpy window
28.05.2024
medium1208. Get Equal Substrings Within Budget
Max substring sum(abs(s[..] - t[..])) < maxCost window
11.05.2024
hard857. Minimum Cost to Hire K Workers
Min cost of k workers each doing quality[i] work for fair rate
30.03.2024
hard992. Subarrays with K Different Integers
Count subarrays with k distinct numbers
28.03.2024
medium2958. Length of Longest Subarray With at Most K Frequency
Max subarray length with frequencies <= k
04.02.2024
hard76. Minimum Window Substring
Let's try to shorten the code
22.10.2023
hard1793. Maximum Score of a Good Subarray
Max of window min (window size) for window having nums[k]
20.09.2023
medium1658. Minimum Operations to Reduce X to Zero
Min suffix-prefix to make an x
8.09.2023
easy118. Pascal's Triangle
Pascal Triangle
16.08.2023
medium239. Sliding Window Maximum
List of sliding window's maximums
7.07.2023
medium2024. Maximize the Confusion of an Exam
Max same letter subarray replacing k letters
20.06.2023
medium2090. K Radius Subarray Averages
Array containing sliding window of size 2k+1 average or -1
06.06.2023
easy1502. Can Make Arithmetic Progression From Sequence
Is IntArray can be arithmetic progression?
5.05.2023
medium1456. Maximum Number of Vowels in a Substring of Given Length
we can use Set to check if it is a vowel
03.03.2023
medium28. Find the Index of the First Occurrence in a String
carefull with indexes
4.02.2023
medium567. Permutation in String
to decrease cost of comparing arrays, we can also use hashing