TLE in Tiling Problem 2

I tried using recursion method like in the example of 4xN. I used MOD value and long long but still it is giving TLE. I solved it without recursion.
Is it possible to solve this using recursion given the constraints and not get TLE?

hello @brucewayne
no we cant solve it with only recursion.

we need dynamic programming for its optimisation

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.