Question DSA-TP-0021
EasyUsing two pointers at both ends of the sorted array [1, 2, 4, 7, 11], which pair is found with sum 15?
- A.
4 and 7
- B.
4 and 11
- C.
Show answer and explanation
Answer: B
1 + 11 = 12 < 15, move left; 2 + 11 = 13 < 15, move left; 4 + 11 = 15. Found.