Knapsack Problem WA !!

I was attempting this question https://www.codechef.com/problems/KNPSK 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 (https://www.codechef.com/viewsolution/9425592) solution covering all the cases

1 Like

@admin123 @mugurelionut @likecs Please help me with the recent solution https://www.codechef.com/viewsolution/9425592

I tried my best still not getting AC

This is my final solution … Please help me with this https://www.codechef.com/viewsolution/9425592