Given item weights, values, and a knapsack capacity, return the maximum value achievable when each item can be chosen unlimited times. This is the standard unbounded knapsack maximization problem.
weights = item weights, values = item values, capacity = knapsack capacity
maximum total value with unlimited copies allowed
Example 1:
Input:
weights = [2,3,4] values = [15,20,30] capacity = 7
Output:
50
Explanation:
Take weights 3 and 4 for total value 20 + 30 = 50.
Example 2:
Input:
weights = [1,3,4] values = [10,40,50] capacity = 6
Output:
80
Explanation:
Take two items of weight 3 for value 80.