Python Recursive solution 0/1 knapsack
make all the possible dessert and sort them with the abs difference.\n\nclass Solution(object):\n    def __init__(self):\n        self.toppings = [0]\n        \
make all the possible dessert and sort them with the abs difference.\n```\nclass Solution(object):\n    def __init__(self):\n        self.toppings = [0]\n        \n    def closestCost(self, baseCosts, toppingCosts, target):\n        self.knapsack(toppingCosts, 0, 0, target)\n        possibilities = [[b + t, abs(target-(b+t))] for b in baseCosts for t in self.toppings ]        \n        possibilities.sort(key=lambda x: [x[1], x[0]])\n        return possibilities.pop(0)[0]\n    \n    def knapsack(self, tc, i, total, target):\n        if i == len(tc):\n            self.toppings.append(total)\n            return \n        self.knapsack(tc, i+1, total + 2*tc[i], target)\n        self.knapsack(tc, i+1, total+tc[i], target)\n        self.knapsack(tc, i+1, total, target)\n```
[]