Hi, I am not passing last test case

Can you help me debug my code
My code :

Happy Holi and thanks!

@ayushjain.iitg
hello Ayush,
in line no 59 replace siz < s with siz <= s
rest everthying is correct.

1 Like

Yes, it worked, but knapsack cannot be filled completely, it was mentioned in explaination of the sample test case, then why this is workking??

@ayushjain.iitg
no u can fill upto maxweight

1 Like

I misunderstood - my bad!