Two Sum
easyFind two numbers that add up to target using hash map
Two Sum
Key Insight
Use hash map to store complements. For each num, check if (target - num) exists.
Step 1Setup
Find two numbers summing to 9
Array
2
07
111
215
3HashMap
Empty
Create empty hash map to store {value: index}. Target = 9.
1 / 4