Doubt in tiling probelm - recursion

For n = 0, why we are returning 1? Why not 0?

hello @gambhirrahul0 0 is frepresenting the 0th row task we have to perform.
when i==m then then i-m=0 and wec will add that option to our case .
alsop at 0th row we can place our tile horizontally only.

Hey! I’m not getting you.

hello @gambhirrahul0 have you understood the rest code of this question?

yes, I understood the rest of the question.

then you have to understand that when i>m then only we can place the tile vertically.
so at 0th row the we can place the tile horizontally only.that why at oth and 1st row then there is only 1 option available.
thats why we have done like that.
Happy Learning !!

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.