Tilling Problem 2

Why is my code giving TLE? It’s working fine in local system and I have used MOD too. Please point out the mistake.

Please use memoization or concept of dp and if you havent studied them please wait till you study them in your course before attempting this problem

Ideally yes, but the question is under the challenges sections of Recursion in the course, that’s why I did without memoization.

even memorization involves recursion.

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.