LeetCode 837: New 21 Game
A clear explanation of the New 21 Game problem using probability dynamic programming and a sliding window sum.
36 notes
A clear explanation of the New 21 Game problem using probability dynamic programming and a sliding window sum.
A clear explanation of Fruit Into Baskets using a sliding window with at most two distinct fruit types.
A clear explanation of making all bits equal to 1 using greedy left-to-right flips and a sliding window flip parity.
A clear explanation of counting subarrays with exactly k distinct integers using the at-most-k sliding window trick.
A clear explanation of finding the longest subarray whose adjacent comparisons alternate between greater-than and less-than.
A clear explanation of solving Number of Recent Calls using a queue as a sliding time window.
A clear explanation of solving Binary Subarrays With Sum using prefix sums and a frequency map.
A clear explanation of counting contiguous subarrays whose maximum value lies inside a given inclusive range.
A clear explanation of counting contiguous subarrays whose product is less than k using a sliding window.
Find three non-overlapping subarrays of length k with maximum total sum and return the lexicographically smallest starting indices.
Find the earliest day when two turned-on bulbs have exactly k turned-off bulbs between them using a sliding window over bloom days.
A clear explanation of finding the longest strictly increasing contiguous subarray using a single scan.
A clear explanation of finding the k closest elements to a target using binary search and a sliding window.
A sliding window solution for finding the maximum average among all contiguous subarrays of fixed length k.
A heap-based solution for finding the smallest range that contains at least one number from each sorted list.
A clear explanation of finding the maximum value in every sliding window using a monotonic deque.
A clear explanation of Permutation in String using a fixed-size sliding window and character frequency counts.
A clear explanation of finding the longest run of 1s after flipping at most one 0 using a sliding window.
A clear explanation of maintaining the median of each fixed-size window using two heaps and lazy deletion.
Find all starting indices where an anagram of p appears in s using a fixed-size sliding window.
A clear explanation of finding the longest substring that can become all one letter using a sliding window.
A clear explanation of finding the longest substring where every character appears at least k times using divide and conquer.
A clear explanation of Moving Average from Data Stream using a queue and rolling sum.
A clear explanation of Longest Substring with At Most K Distinct Characters using a sliding window and character counts.
A clear explanation of checking nearby indices with nearby values using a sliding window and bucket hashing.
A clear explanation of detecting whether equal values appear within distance k using a hash map or sliding window set.
A clear explanation of finding the shortest contiguous subarray whose sum is at least target using a sliding window.
A detailed guide to solving Minimum Window Substring with a sliding window and frequency counters.
A clear explanation of finding repeated 10-letter DNA substrings using a fixed-size sliding window and hash sets.
A clear explanation of finding the longest substring with at most two distinct characters using a sliding window.
A clear explanation of finding all starting indices where a substring is formed by concatenating every word exactly once.
A clear explanation of the longest substring problem using sliding window and a hash set.
Maintain a contiguous window over an array while moving its left and right boundaries.
Maintain the median of a sliding window using two heaps while the window moves over a stream.
Maintain sorted order over a moving window of the most recent elements in a stream.
Compute hash values for sliding windows over a sequence in constant time by incrementally updating rather than recomputing.