0 1 knapsack ques link: https://hack.codingblocks.com/contests/c/512/257
0 N knapsack ques link:https://hack.codingblocks.com/contests/c/512/922
my code link: https://ide.codingblocks.com/s/44604
The doubt is commented in the code.
Please clear the doubt.