Advanced Problem Solving and Revision
Lesson 20 of 20Race two pointers to a pair summing to 20, slide a window under budget 9, then pocket the course complexity cheat-sheet.
Sorted array, target 20. Sum the two ends, then retire one end per comparison.
Grow on the right, shrink on the left — the window stays valid or gets smaller.
The converging pair hunt, then the budget window — both single-pass, both in real C++.
Six loads, budget 9. The window grows right and shrinks left — nothing is ever re-summed.
Kadane in six numbers — one pass, one running sum, one peak.
Click a technique, then click its cost to lock the pair.