Given weights
: list of weights where weights[i]
represents the weight of i-th
item,
values
: list of values where values[i]
represents the value of i-th
item,
and capacity
, total capacity available,
Find the maximum values that can be achieved within the limit of total weight.
same items can be used multiple times
weights = [1,2,3,5]
values = [1,4,7,10]
capacity = 8
Output: 18