Question DSA-HASH-0029
EasyWith a hash map, how fast can you find whether two numbers in an array add up to a target?
- A.
O(n²)
- B.
O(1)
- C.
O(n log n)
- D.
O(n) on average
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Hashing question
With a hash map, how fast can you find whether two numbers in an array add up to a target?
O(n²)
O(1)
O(n log n)
O(n) on average
Sign up free to see the answer and a step-by-step explanation.