Not getting proper output

can u plz edit and identify my mistake

there are few mistakes in case of considering the item
this is correct way

 if(capacity>=weight[n-1]) {
        with=prices[n-1]+find_max(weight,prices,n-1,capacity-weight[n-1]);
    }

Modified Code

i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course

1 Like