W7SQ6Y5Q5ENYYWQDSGO6GOUN5GTAKH6RY2C5D544PAJZRXI63RIQC
DLV4V3KAK2TKD77QGXMG65FUJ6OTCRJJZ3BHOBXD2ISJWNJWUQ4AC
if err != nil { return err } n, err := findPair(nums) if err != nil { return err } log.Println("PAIR:", n) t, err := findThree(nums)
if err != nil {
return err
}
n, err := findPair(nums)
log.Println("PAIR:", n)
t, err := findThree(nums)
log.Println("THREE:", t) return nil}func findThree(nums []int) (int, error) {
log.Println("THREE:", t)
return nil
func findThree(nums []int) (int, error) {
for k := j + 1; k < len(nums); k++ { if n+nums[j]+nums[k] == MIGHTY { return n * nums[j] * nums[k], nil } } } } return 0, fmt.Errorf("triplet have not found")}func findPair(nums []int) (int, error) { for i, n := range nums { for j := i + 1; j < len(nums); j++ {
for k := j + 1; k < len(nums); k++ {
if n+nums[j]+nums[k] == MIGHTY {
return n * nums[j] * nums[k], nil
return 0, fmt.Errorf("triplet have not found")
func findPair(nums []int) (int, error) {
for i, n := range nums {
for j := i + 1; j < len(nums); j++ {
log.Println(n * nums[j]) return nil
log.Println(n * nums[j])
return n * nums[j], nil
return fmt.Errorf("pair have not found")
return 0, fmt.Errorf("pair have not found")