Python | Backtracking | Simple
```\nclass Solution:\n    def bt(self, index, stack):\n        if index>=len(self.toppingCosts):\n            if self.minDiff>abs(self.target-sum(stack)):\n    
```\nclass Solution:\n    def bt(self, index, stack):\n        if index>=len(self.toppingCosts):\n            if self.minDiff>abs(self.target-sum(stack)):\n                self.minDiff= abs(self.target-sum(stack))\n                self.resStack=stack\n            return \n\n        for i in range(3):\n            self.bt(index+1, stack+[i*self.toppingCosts[index]])\n    \n    def closestCost(self, baseCosts: List[int], toppingCosts: List[int], target: int) -> int:\n        \n        self.resStack=[]\n        self.target= target\n        self.minDiff = float(\'inf\')\n        self.toppingCosts= toppingCosts\n        \n        for i in range(len(baseCosts)):\n            self.bt(0, [baseCosts[i]])\n        \n        return sum(self.resStack)
['Backtracking', 'Python', 'Python3']