Unable to solve using recursion

giving TLE… not working for more than one testcases

hello @arsalaan997
recursive solution has high time complexity that why it is giving tle.
Apply dynamic programming to pass all test cases.
if u r not familar with it then leave this problem for now,
try again after learning dp.

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.