python combination
\tclass Solution(object):\n\t\tdef closestCost(self, baseCosts, toppingCosts, target):\n\t\t\t"""\n\t\t\t:type baseCosts: List[int]\n\t\t\t:type toppingCosts: L
\tclass Solution(object):\n\t\tdef closestCost(self, baseCosts, toppingCosts, target):\n\t\t\t"""\n\t\t\t:type baseCosts: List[int]\n\t\t\t:type toppingCosts: List[int]\n\t\t\t:type target: int\n\t\t\t:rtype: int\n\t\t\t"""\n\t\t\tself.ans = float(\'inf\')\n\t\t\ttoppingCosts.sort()\n\t\t\tfor base in baseCosts:\n\t\t\t\tself.dfs(toppingCosts, target, base)\n\t\t\treturn self.ans\n\n\t\tdef dfs(self, topping, target, sums):\n\t\t\tif abs(target - sums) < abs(self.ans - target):\n\t\t\t\tself.ans = sums\n\t\t\tif sums > target: return \n\t\t\tfor i in range(len(topping)):\n\t\t\t\tself.dfs(topping[i + 1:], target, sums + 0*topping[i])\n\t\t\t\tself.dfs(topping[i + 1:], target, sums + 1*topping[i])\n\t\t\t\tself.dfs(topping[i + 1:], target, sums + 2*topping[i])
[]