Multiple ChoiceIntermediate 30s
Two Pointers: Pair Sum
Finding a pair that sums to a target in a sorted array with two pointers:
Options
- 1Start pointers at both ends, move inward based on sum vs target
- 2Randomly select pairs of elements and check their sum against target
- 3Use a hash table only, ignoring the array's existing sorted order
- 4Use a nested loop to test every pair of elements in the array
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.