Getting wrong ans


getting wrong output pls check the code

hello @souravkhanna227
in this code u are asked to report largest subtree that is bst.

but u approach will give largest bst possible but it may or maynot consider whole subtree.

one simple approach is to go to each node , check if that subtree is bst or not ,
and then update ur largest bst size accordingly

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.