Where is my mistake?

here is my code >>>https://ide.codingblocks.com/s/607827

sir, some of test cases showing MLE.

where is am doing mistake ?

is there any different logic in this question?

hi… so firstly read the ques "There is a little twist for 0-N knapsack. You can pick an element more than once. "
secondly pass vectors by reference and your issue will be resolved otherwise a copy of vector will be made for each call.

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.