Skip to content
Ravnary
A Knowledge Platform
Categories
Learn
Cheatsheets
Paths
Favourites
Review
Community
Colour theme
Light
Dark
System
Learn
Coding Interview Patterns
Choosing
Choosing a Pattern
Quiz
Q 01
/ 04
Intermediate
Question 1 of 4. 0 correct, 0 incorrect.
An array is sorted, and the task is to count the pairs whose sum is below a target. Which approach fits best?
Two pointers, O(n)
A hash map of complements, O(n)
A binary search for each element, O(n log n)
Check answer
Home
Learn
Paths
Saved
Community