codeLink : https://pastebin.com/88tQrh0j
why I am getting no output for my code , please look into my code
Tilling problem II
Hey @Divya_321
In the given question, the range of n and m given is:
1 <= N,M <= 100000
which is large, and your code is recursive, so it gives time limit exceeded for cases with huge values of m and n, though it does work for smaller values, so for your code to run for all cases, you need to optimize it using dp or memoization.
but it’s recirsion topic, not dp and till yet meomoization and dp is not taught
Umm, your recursion approach is correct, so for now, it’s good that you’ve solved it using recursion. Once you are taught dp/memoization, solve this question using it and then submit.
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.