```python
from typing import (
List,
)
class Solution:
"""
@param nums: the input array
@param target: the target number
@return: return the target pair
we will sort your return value in output
"""
def two_sum_v_i_i(self, nums: List[int], target: int) -> List[List[int]]:
# write your code here
find = {}
res = []
if len(nums) < 2:
return res
for i, num in enumerate(nums):
if num in find:
res.append([find[num], i])
if abs(target - num) < abs(num):
continue
find[target - num] = i
return res
```