Solution not available

The code given as the solution for this problem uses DP but the section is recursion. I am not able to figure out error in my code!

hi @ad733943 you can use recursion with memoization to pass the test cases.

ohh it won’t work with normal recursion?
edit: sorry i didnt actually calculate the time complexity required.

@ad733943 time complexity of normal recursion is really high (exponential) so you need to use DP or memoization

1 Like

@ad733943 please mark doubt as resolved if you dont have any further queries

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.