dsa2 min read
Permutation in String [Medium] — Fixed Window Character Count
Check if any permutation of s1 is a substring of s2 using a fixed-size sliding window with character frequency comparison.
Read →
webcoderspeed.com
1276 articles
Check if any permutation of s1 is a substring of s2 using a fixed-size sliding window with character frequency comparison.
Find the maximum fruits you can collect starting from any tree with two baskets (at most 2 distinct fruit types) using a sliding window.
Find the maximum sum of a subarray with all unique elements using a sliding window backed by a HashSet.
Find the smallest subarray with sum >= target using a variable sliding window that shrinks from the left when the condition is met.
Count tuples (i,j,k,l) where nums1[i]+nums2[j]+nums3[k]+nums4[l]=0 by hashing all pairs from first two arrays.