
Given an integer array nums (length n) and an integer target, return the indices (i, j) such that:
i != j
nums[i] + nums[j] == target
You may assume exactly one valid pair exists.
2 <= n <= 2 * 10^5
-10^9 <= nums[k], target <= 10^9
nums
,
target
[i, j]
(order does not matter)
nums = [2, 7, 11, 15]
,
target = 9
→ output could be
[0, 1]