Given an array of integers nums and an integer target, return the indices of the two different elements whose values add up to target.
Exactly one valid answer exists. Return the two indices in increasing order.
Inputnums = [2, 7, 11, 15], target = 9
Output[0, 1]
2 and 7 add up to 9. Their zero-based indices are 0 and 1.
Inputnums = [3, 2, 4], target = 6
Output[1, 2]
2 and 4 add up to 6. Their zero-based indices in the original array are 1 and 2.
2 ≤ nums.length ≤ 10,000