funcchange(coins []int, kinds int, num int)int { if num == 0 { return0 } if cost, ok := memo[num]; ok { return cost } minCost := 0x7FFFFFFF for i := 0; i < kinds; i++ { if num - coins[i] >= 0 { curCost := change(coins, 3, num - coins[i]) if curCost < minCost { minCost = curCost } } }