The Classic 75 Stage 1 of 75
Appearance
Palette
Start each problem at
Write shows nothing of the solution until you ask. Kept on this device, not in your account.
Hash mapEasy
Find the two numbers in nums that add up to target, and return their indices.
Aim for O(n) time, O(n) spaceInspired by a classic interview problem ↗
The practice panel runs the code in your browser, so it needs JavaScript.