CodeMosa
Master LeetCode Patterns
All Patterns
Collections
Sign In
Back
Two Pointers
Question 1 of 14
7% Complete
Easy
Which pattern would you use to find a pair of numbers that sum to a target in a sorted array?
A
Opposite-ends shrink (two pointers from start and end)
B
Sliding window with fixed size
C
Binary search on each element
D
Hash map to store complements
Need a hint?
Think about starting from both ends of the array