Tiling problem-recursion

how will i know when will the tiles are placed horizontally and when they are placed vertically

Hi abhishekredwal
Understand the question properly:
Given a floor of size n x m. Find the number of ways to tile the floor with tiles of size 1 x m
Explanation : There are two ways to place a tile

  1. Horizontally, tile size = 1xm, no problem as you can always place it if a row is empty
  2. vertically, tile size = mx1, you have to check if m<=n i.e atleast m rows are empty

Hope it helps
Please mark resolved if satisfied :slight_smile:

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.