Notice Period
visualization

Two Pointers

Each comparison kills a whole row of candidates.

nums = [1, 3, 4, 6, 8, 11, 13] · target = 10step 1/12
L1346811R13

Sorted array. L starts at the smallest value, R at the largest. Target sum: 10.

pseudocode
L, R = 0, len(nums) - 1
while L < R:
if nums[L] + nums[R] == target:
return (L, R)
elif nums[L] + nums[R] < target:
L += 1 # sum too small
else:
R -= 1 # sum too big