I am not able to solve this problem

i am not able to write the base cases for this problem

@agarwalarjit.agarwal
hello arjit,
ur base case should be
if n<m
return 1
if n==m:
return 2;

please explain these base cases

the code is still not working

@agarwalarjit.agarwal

if n<m
then there is only one way to put tiles and that way is to put tiles horizontally.

if n==m
then we will have two ways.
i.e either put all tiles vertically or all tiles horizontally.

probably u r facing tle becuase time complexity of this reursive solution is high
and to optimise it we will need dynamic programming