What The Left Move Discards
Sorted array a = [1, 4, 5, 7, 11], target x = 16. Opposite-direction pointers start at l = 0 and r = 4. Since a[0] + a[4] = 12 < 16, the algorithm executes l += 1.
Which pairs does that single step rule out, and on what grounds?
Sign in to answer questions and track your progress
Sign In