package main
import (
"fmt"
)
// complexity O(n)
func getArrayCombination(arr []int, target int) []int{
tampungData := make(map[int]int,0)
for index, data := range arr{
searchNumber := target-data
if value, found := tampungData[searchNumber]; found {
return []int{tampungData[value],index}
}
tampungData[data] = index
}
return []int{}
}
func main() {
fmt.Println(getArrayCombination([]int{1,2,3,4,9}, 10))
}