Two Pointers
Walk two indices through an array to replace a nested loop with a single pass.
The problem
You get a sorted array a of n numbers and a target T. Find two different positions i < j with a[i] + a[j] = T, or report that none exist.
1 of 9