Tiling problem II

the problem is giving tle using recursion. How to sort that??

Hello @jha.aparna17, you need to use DP or memoize this by storing the states for respective values of n and m.

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.

https://ide.codingblocks.com/s/402368 I tried solving using dp but its giving error

Hello @jha.aparna17 you are declaring your dp array of 2dimensional which is very big in size.
please correct that.
and also you can solve this question using 1d dp as well.
Here for your reference i am attaching the code:


if you have any doubt you can ask here;
Happy Learning!!