dsa2 min read
Substring with Concatenation of All Words [Hard] — Multi-Start Window
Find all starting indices of substrings that are concatenations of all given words using a sliding window for each possible word-aligned start.
Read →
webcoderspeed.com
1276 articles
Find all starting indices of substrings that are concatenations of all given words using a sliding window for each possible word-aligned start.
Find the minimum number of consecutive cards that contain a matching pair using a HashMap tracking last seen positions.
Count subarrays where score = sum × length is less than k using a shrinkable sliding window with running sum.
Find the smallest window in s containing all characters of t using a have/need counter to track when the window is valid.
Find the maximum in every sliding window of size k in O(n) using a monotonic decreasing deque of indices.