You are given an integer array nums and an integer target.
Your task is to find two distinct indices i and j such that nums[i] + nums[j] = target.
You may assume that:
Return the two indices [i, j].
nums = [1, 2, 3, 5]
target = 5
[1, 2]
Because nums[1] + nums[2] == 5, we return [1, 2].
nums = [3, 2, 4]
target = 6
[1, 2]
Because nums[1] + nums[2] == 6, we return [1, 2].
nums = [2, 2, 1]
target = 4
[0, 1]
Because nums[0] + nums[1] == 4, we return [0, 1].
nums = [1, 2, 3, 5]
target = 5
[1, 2]