Knapsack Problem WA !!

I was attempting this question KNPSK Problem - CodeChef getting WA for the same. What’s wrong with the following solution.

https://www.codechef.com/viewsolution/9144714

EDIT:-
I finally came up with this (CodeChef: Practical coding for everyone) solution covering all the cases

1 Like

@admin123 @mugurelionut @likecs Please help me with the recent solution CodeChef: Practical coding for everyone

I tried my best still not getting AC

This is my final solution … Please help me with this CodeChef: Practical coding for everyone