← All topics
Two Pointers Quiz: questions with answers
8 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What must usually be true of an array to use opposite-end two pointers for a pair sum?
- Q2. In Two Sum II (sorted array), the current sum is SMALLER than the target. What do you do?
- Q3. What is the time and extra space of two-pointer Two Sum on a sorted array?
- Q4. In Container With Most Water, which pointer should move?
- Q5. What does nums look like after this code runs on [0, 1, 0, 3, 12]? (code)
- Q6. Why does 3Sum sort the array first? (select all that apply)
- Q7. When merging two sorted arrays into the first array's extra space, from which end do you fill?
- Q8. Is "racecar" a palindrome? Type yes or no.