← Two Pointers Quiz: all 8 questions
Two Pointers Quiz · Question 1 of 8
What must usually be true of an array to use opposite-end two pointers for a pair sum?
What must usually be true of an array to use opposite-end two pointers for a pair sum?
- A.It is sorted
- B.It has no duplicates
- C.It has an even length
- D.All values are positive
Answer & explanation
Correct answer: It is sorted
Moving left increases the sum and moving right decreases it only because the array is sorted.
Can you get the rest right without peeking?
Take the timed Two Pointers Quiz quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →