0-1 Knapsack Problem

In the base case, the condition for capacity c should be if(c<=0) but why it is just if(c==0) ? c can go negative also that is why we must take that case in the base case?

Hi… u can write that also… it is still correct and will pass all test cases

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.