Discussion About 0-1 Knapsack

This is Discussion thread about 0-1 Knapsack

my 2 test cases are not passing in this problem when i am not using dp
ide: https://ide.codingblocks.com/s/180877