Python backtracking short code
\nclass Solution:\n    def closestCost(self, baseCosts: List[int], toppingCosts: List[int], target: int) -> int:\n        ans = float(\'inf\')\n        \n\t\t# 
```\nclass Solution:\n    def closestCost(self, baseCosts: List[int], toppingCosts: List[int], target: int) -> int:\n        ans = float(\'inf\')\n        \n\t\t# memo to accelerate\n        @lru_cache(None)\n        def helper(idx, comb):\n            nonlocal ans\n            if abs(comb - target) == abs(ans - target):\n                ans = min(ans,comb)\n            if abs(comb - target) < abs(ans - target):\n                ans = comb\n            for i in range(idx, len(toppingCosts)):\n                helper(i + 1, comb)\n                helper(i + 1, comb + toppingCosts[i])\n                helper(i + 1, comb + 2 * toppingCosts[i])\n\n        for bc in baseCosts:\n            helper(0, bc)\n\n        return ans\n            \n            \n```
['Backtracking', 'Python']