i only passed one test case.
where is the problem.
Where i am doing wrong in 0-1 knapsack ? [dp]
Edit at line 31:
dp[i][j] = max(dp[i-1][j],dp[i-1][j-size[i]]+price[i]);
1 Like
Edit at line 31:
dp[i][j] = max(dp[i-1][j],dp[i-1][j-size[i]]+price[i]);