None of the test cases are passing

Sir/Ma’am

Sir i tried implementing the same logic as 0-N knapsack but with a little more change but it didn’t work out .

Please have a look at my code : https://ide.codingblocks.com/s/291030

@sinhadivyam19 hey you have missed few things in your logic actually we have to handle -1 cases properly,check this code you will get it:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.