0/1 knapsack
Your task
You have a knapsack of integer capacity. Each item is given as [weight, value] and can be taken at most once. Return the maximum total value of a subset whose total weight does not exceed the capacity. Capacity is non-negative; the item list may be empty.
Examples
knapsack_01(capacity: int, items: list[list[int]]) -> intExample 1
Input
knapsack_01(10, [[5, 10], [4, 40], [6, 30], [3, 50]])Output
90