Two Sum II - Converging Pointers

Place one pointer at the start and one at the end. The sorted property lets you decide which pointer to move.

1.1. Compute sum = nums[left] + nums[right].

2.2. If sum == target, return the indices.

3.3. If sum < target, you need a larger sum. Move left right.

4.4. If sum > target, you need a smaller sum. Move right left.

This works because moving the wrong pointer can only make things worse.