I'm getting TLE

I am getting TLE in tilling-II problem I think my solution is optimal but I can’t figure out any better approach

@singh_hrmn
hello Harmandeep,
I have checked ur solution .it is correct but because u are using recursion its time complexity is exponential.

to optimise it use dynamic programming

thanks but this question is part of recursion and backtracking challenges. Can you tell me how to optimise this problem using recursion and backtracking only ??

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.