Issues with code

Out of 4 test cases only 2 has passed.
Not able to identify mistake.

Please comment out in my code where i have done mistake and share ide.

Code : https://ide.codingblocks.com/s/355563

Problem Colourful Knapsack (DP CHALLENGE)

Hello @Sus
ur logic is correct.

handle -1 case .
image

and then try

@Sus
take help from this code->

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.