Please check my code for Tilling Problem -2 it is giving TLE

Please check my code for Tilling Problem -2 it is giving TLE. I have not studied DP yet so explain me recursive approach only. Here is my code:

http://p.ip.fi/mMM0

hi @rohitgarg025 time complexity of recursion alone is very high so you’ll have to use memoization to reduce the time complexity

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.