Given weights and values of n items, and a knapsack capacity W, find the maximum value of items that can be put in the knapsack if an unlimited number of instances of each item can be used.
{
"wt": [
1,
3,
4,
5
],
"val": [
10,
40,
50,
70
],
"W": 8
}110{
"wt": [
2,
3,
7
],
"val": [
5,
8,
10
],
"W": 10
}26{
"wt": [
1
],
"val": [
10
],
"W": 5
}50Sign in to Run Code and Submit