mediumStudy question · answer published in Data Structures and Algorithms interview questions, so no pointshash-maptwo-sum
Order of steps in Two Sum
In one-pass Two Sum, why do you look up target - x before adding x to the map?
Discussion 0
Join free to post in the discussion.
Related questions
- Average cost of a hash map lookupBackend Developer
- Worst case for a hash map lookupBackend Developer
- Removing duplicates with a SetBackend Developer
- Number keys in a plain objectBackend Developer
- Iteration order of a MapBackend Developer
- When to choose Map over a plain objectBackend Developer
- Set of look-alike objectsBackend Developer
- Counting letters in a wordBackend Developer