Tiling problem II using recursion

Excuse me sir
I have been trying to solve this code using recursion yet i am unable to clear the TLE can you please help me out

this is my code https://ide.codingblocks.com/s/646214

hi @swaroop_stellar
there are many overlapping subproblems in this ques, hence u will have to use dynamic programming to avoid TLE…
refer this–>

Is there anyway to solve this question using recursion as DP isn’t completed yet but this was asked in the recursion exercise

hi @swaroop_stellar
ur code was correct, but time limit set in this ques is such that without DP u will get TLE only… so don’t worry, recursion wise ur code is correct…

1 Like

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.