🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.It is sorted
  2. B.It has no duplicates
  3. C.It has an even length
  4. 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 →