Tiling Problem using Recursion

If there is 4x4 matrix and if we have to put 4x1 then total ans will be 4 ??

hello @ashwani225
answer will be 2.
because
you can put all tiles as 4X1 , 4X1 ,4X1,4X1
or
1X4
1X4
1X4
1X4

no other configuration is possible.

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.

In 4x4 matrix then f(n)=f(n-1)+f(n-4), So n=4 then f(4-1)+f(4-4) => 3+0 =3 but ans is 2. I am little bit confused please help

f(3) will be 1.

draw a digram for the same ,and see how many ways u are getting.

for n<m there will be only one way to place tiles.

correct base cases are->
if n<m return 1.
if n==m return 2.
otherwise
return f(n-1)+f(n-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.