Given an integer array nums and an integer target, return the indices of the two numbers such that they add up to target. You may assume that each input has exactly one solution, and you may not use the same element twice.
This is the canonical one-pass hash map problem: as you scan nums, for each x check if target - x has already been seen; otherwise store x → index for future lookups.
Example: nums = [2,7,11,15], target = 9 → [0,1] (because nums[0] + nums[1] == 9).
[0,1]