One test case is not passing

@G_rahil
as the sum can be very large of order ~1e7,
you cannot create a n*sum size array.
so you have to solve this problem using 1D array.
I have corrected the code, I strongly advise to knapsack in 1D array yourself first before jumping on to the soln.

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.