package main

/**
  * 
  * @param numbers int整型一维数组 
  * @param target int整型 
  * @return int整型一维数组
*/
// func twoSum( numbers []int ,  target int ) []int {
//     hashTab := map[int]int{}

//     for i, v := range numbers {
//         if k, ok := hashTab[target - v]; ok {
//             return []int{k+1, i+1}
//         }
//         hashTab[v] = i
//     }
//     return nil
// }

func twoSum(numbers []int, target int) []int {
    hashTab := map[int]int{}

    for i, v := range numbers {
        if k, ok := hashTab[target-v]; ok {
            return []int{k+1,i+1}
        }
        hashTab[v] = i
    }
    return nil
}