Getting TLE in few test Cases

Here’s the link to my code of the Tilling problem II in the Recursion’s Challenges Section. Please tell what is it that I am doing wrong. Have taken the base to correct or not?

@isa67719 hey mohd test cases of this problem require more computation so try to approach with dynamic programming.

@isa67719
The constraints mentioned in this problem are a bit tight and hence you will not be able to solve this problem completely using just recursion. You need to optimise your approach , which is where Dynammic Programming comes in. Try optimising your solution using DP. If you have only covered the recursion section and not reached till DP in your course , I suggest you to leave this problem for now and come back to it when you cover DP. Since your recursive approach seems right , you have already got the most part . Adding Memoization ( DP technique ) to your code would be easy for you later.

Alright. I will try the problem after learning Dynamic Programming.