Lowest common ancestor

why there is condition with leftans and not with rightans, in general when do this type of question we do the same for both left and right sides so why not here, i know code is working but how ??

if(leftans->left!=NULL)
return leftans;
return rightans;

Hi @anujsharmabadboy… can u share the code as like this I am unable to understand what exactly u are saying…
https://ide.codingblocks.com/s/315177 u can also go though my code

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.