Please elaborate the logic

please elaborate the logic behind the question

i cant undrestand the question

@mohdkaifalam041 Tile placed horizontally(one row is covered now recurse for remaining rows):-
countWays(n - 1, m)

Tile placed vertically if and only if :-
if(n - m >= 0) {
countWays(n - m, m)
}
Now where is the issue, try to visualize the case for 4*3.
there is a 4 * 3 floor, then you have a 1 * 3 tile.

  • Now if you place the tile horizontally then you have 3 * 3 floor left to tile.
    So you make a call for say tiling(n - 1) i.e n - 1 rows left to tile.
  • Now one vertical call is made by you in the code. So your work is to add the horizontal call.