Sir doubt in 0/1 knapsack

sir why is this code failingfor two test cases

hello @tejasddongare
pls share ur code using cb ide