Python 3 solution: Minimizing the error using backtracking
python\nclass Solution:\n    def closestCost(self, baseCosts: List[int], toppingCosts: List[int], target: int) -> int:\n        toppingCosts *= 2\n        \n   
```python\nclass Solution:\n    def closestCost(self, baseCosts: List[int], toppingCosts: List[int], target: int) -> int:\n        toppingCosts *= 2\n        \n        best_error = float("inf")  # best error can be greater than `target`\n        \n        @cache\n        def findError(index, target):\n            if index == len(toppingCosts):\n                return target\n            elif target < 0:\n                return target\n            return min(findError(index + 1, target - toppingCosts[index]),    \n                       findError(index + 1, target), key = lambda x : (abs(x), -x))\n\n        for base in baseCosts:\n            err = findError(0, target - base)\n            best_error = min(best_error, err, key = lambda x: (abs(x), -x))\n\n        return target - best_error\n```
['Backtracking', 'Recursion', 'Python', 'Python3']