[Python] Clear DFS Solution with Video Explanation
Video with clear visualization and explanation:\nhttps://youtu.be/zdk_9kDV2Bg\n\n\n\n\nIntuition: dfs(brute force)\n \n\nCode\n\nclass Solution:\n    def closes
Video with clear visualization and explanation:\nhttps://youtu.be/zdk_9kDV2Bg\n\n\n\n\nIntuition: dfs(brute force)\n \n\n**Code**\n```\nclass Solution:\n    def closestCost(self, baseCosts: List[int], toppingCosts: List[int], target: int) -> int:\n        self.res = float(\'inf\')\n        \n        for baseCost in baseCosts:\n            self.dfs(toppingCosts, target, baseCost)\n\t\t\n        return self.res\n    \n    def dfs(self, toppingCosts, target, total):\n        if abs(target-total) < abs(self.res-target):\n            self.res = total\n        if total > target: return\n        \n        for i in range(len(toppingCosts)):\n            self.dfs(toppingCosts[i+1:], target, total+0*toppingCosts[i])\n            self.dfs(toppingCosts[i+1:], target, total+1*toppingCosts[i])\n            self.dfs(toppingCosts[i+1:], target, total+2*toppingCosts[i])\n```\n\n\n\nTime: O(m*3^n) \n\n\nFeel free to subscribe to my channel. More LeetCoding videos coming up!
['Python']