Minimum Size Subarray Sum — Shortest Window Reaching Target
LeetCode 209 — find the shortest contiguous subarray whose sum is at least target. A staple FAANG question on the shrinkable sliding window template.
1582 articles
LeetCode 209 — find the shortest contiguous subarray whose sum is at least target. A staple FAANG question on the shrinkable sliding window template.
LeetCode 454 — count quadruples summing to zero across four arrays using meet-in-the-middle hashing. Asked at Google, Amazon, and Bloomberg.
LeetCode 11 — find two lines that hold the most water using a greedy two-pointer scan in O(n). Top-five most asked FAANG two-pointer problem.
LC 881 asks for the minimum boats to rescue everyone given a weight limit and at-most-2-per-boat rule. Sort then greedily pair the heaviest with the lightest using two pointers — O(n log n) time, O(1) space.
LC 15 asks for all unique triplets summing to zero. Sort the array, fix each element as the anchor, and use two pointers to scan for pairs — with careful three-level deduplication. A must-know FAANG pattern.