Time limit exceeded

i am getting TLE after submitting this code.
here is my code

u need to use Dynami Programming since the constraints are large
recursion cases increase in time complexity

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.

You should take modulo 10^9 +7 while calculation and if it is 1xm size tiles then f(n-4,m) should be f(n-m,m), right!