Minumum money needed

sir please help me to find what is wrong with my code i m getting all three test cases wrong here, i’ve used INT_MAX for infinity values but that giving me wrong answers so i changed it 100001 but still not getting correct answers…?
this is my code:

the ide link does not have the code

please check it mam i’ve updated it

mam now ide is working…please take a look…?

@nikhilmeena

It should be unbounded knapsack as we have all weights available at all times. Refer to this : https://www.geeksforgeeks.org/unbounded-knapsack-repetition-items-allowed/

Correct code : https://ide.codingblocks.com/s/152494
u`ll understand where u got wrong in the approach a 1d dp question

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.