Problem
Given an array of integers and a target value, return the indices of the two numbers that add up to the target. Exactly one such pair is guaranteed to exist, and you may not use the same element twice.
Input / Output
nums and an integer target.[i, j] with nums[i] + nums[j] == target and i != j.Constraints
Example
nums = [2,7,11,15], target = 9 → [0,1] because nums[0] + nums[1] == 9.nums = [3,2,4], target = 6 → [1,2].