Tiling Problem - 2

ques:- https://hack.codingblocks.com/contests/c/586/1045
my sol:- https://ide.codingblocks.com/s/44093

I have corrted your recursion code:https://ide.codingblocks.com/s/44143
But the constraints are large so you can’t apply brute force recursion as it will give you TLE.
So do this question with bottom-up approach.

1 Like

https://ide.codingblocks.com/s/44356

Here is my solution for your reference.