New problem: given a sorted array, find two numbers that sum to a target. Brute force: check all pairs. That's . There's a technique that solves this in with no extra space. It's called two pointers, and it's one of the most useful patterns in competitive programming.
Data Structures19 sections · 729 units
Open in CourseThe Pair Finding Problem
A quadratic trap