Minimum money needed

Need some clarity

  1. if 2, 4, - 5 is value than the weight array should be 1 , 2, 3 or weight array will just be constructed for 2 5 as 1 , 3 or 1 , 2
  2. which is the case when bag can’t be filled because according to me since there are infinite items it will always be filled(give an example)

Hi @Divya_321
I am not able to get what u want to ask in ur first query. Can u pls explain what u want to ask.

And, eg. for ur second query is w={2,5} and required weight=3. We can’t make weight=3 using weights 2,5.