Arrays & Hashing · Easy
Two Sum
O(N) · O(N)
Initialize Hash Map
Target is 9. We iterate through nums array and maintain a hash map of { value: index }.
Array Elements & Pointers
2
i=07
i=111
i=215
i=3Live Variables & Invariants
target:9
i:0
current:-
complement:-
Step 1 / 5
20%
Solution Code
LeetCode IDE Console
Test Cases
5 cases from Blind 75 & NeetCode 150
Ask for a hint whenever you get stuck.