Code Showing MLE for 2 test Cases

In my code, I have used top-down approach using memorisation, but it seems as if I have made a mistake in implementing the 2D DP vector. Kindly point out my error. Thank You!!

Hey @paulayush2002
1)Pass vectors by reference both dp and v
2) Add if(sum>k) return false;

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.