Question DSA-ARR-0080
HardWhat is the time complexity of finding all pairs with a given sum in an unsorted array using a hash map, when you only need the count?
- A.
O(n log n)
- B.
O(1)
- C.
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
Arrays question
What is the time complexity of finding all pairs with a given sum in an unsorted array using a hash map, when you only need the count?
O(n log n)
O(1)
Sign up free to see the answer and a step-by-step explanation.
O(n²)
O(n) expected