Dynamic Programming

Question Link : https://www.interviewbit.com/problems/count-permutations-of-bst/

Code : https://ide.codingblocks.com/s/575687

In the code, with the first ‘if’ condition the output is being correct but if I remove this condition and use the condition mentioned in the comment then I get a wrong answer. Why so? Except for (0,0) and (1,0) shouldn’t the output be 0 if either A==0 or B==0?

Hello @deep4013 please ask doubts related to course content.

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.