WA in SPOJ PARTY 0/1 Knapsack

I am getting a wrong answer in this
its working for each and every test case i found

problem link

my solution

I am just guessing, because I barely looked at your code, but haven’t you switched the dimensions of your dp array? Should it be dp[101][501]?

1 Like

Thank you soo much :slight_smile:
that was the only problem
silly mistakes -_-

1 Like
//