In Minimuim Money Needed I applied Knapsack logic and it seems correct but Some Wrong Answer I am getting . Pls Help

Code is Almost correct but some Edge cases wrong … Pls Help

Check for this test case:
5 10
-1 33 -1 176 -1 46 -1 120 -1 300
Expected o/p is: 112
Yours is giving is: 0
Take this code for reference

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.