c# : Easy Solution
\tpublic class Solution\n\t{\n\t\tint min_cost, closest_cost;\n\t\tpublic int ClosestCost(int[] baseCosts, int[] toppingCosts, int target)\n\t\t{\n\t\t\tmin_cos
\tpublic class Solution\n\t{\n\t\tint min_cost, closest_cost;\n\t\tpublic int ClosestCost(int[] baseCosts, int[] toppingCosts, int target)\n\t\t{\n\t\t\tmin_cost = int.MaxValue;\n\t\t\tclosest_cost = int.MaxValue;\n\n\t\t\tfor (int i = 0; i < baseCosts.Length; i++)\n\t\t\t{\n\t\t\t\tSolve(toppingCosts, target, 0, baseCosts[i]);\n\t\t\t}\n\n\t\t\treturn min_cost;\n\t\t}\n\n\t\tpublic void Solve(int[] toppingCosts, int target, int idx, int cost)\n\t\t{\n\t\t\tif(idx >= toppingCosts.Length)\n\t\t\t{\n\t\t\t\tint diff = Math.Abs(target - cost);\n\n\t\t\t\tif (diff < closest_cost || (diff == closest_cost && cost < min_cost))\n\t\t\t\t{\n\t\t\t\t\tclosest_cost = diff;\n\t\t\t\t\tmin_cost = cost;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (int k = 0; k < 3; k++)\n\t\t\t{\n\t\t\t\tSolve(toppingCosts, target, idx + 1, cost + k * toppingCosts[idx]);\n\t\t\t}\n\t\t}\n\t}
[]