You are given an array of integers `nums` and an integer `target`. Return the indices of the two numbers in the array that add up to `target`.
Explanation: Because `nums[0] + nums[1] == 2 + 7 == 9`, we return `[0, 1]`.
Explanation: Because `nums[1] + nums[2] == 2 + 4 == 6`, we return `[1, 2]`.
Explanation: Because `nums[0] + nums[1] == 3 + 3 == 6`, we return `[0, 1]`.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak