Wrong output given by the code

@Mudit809 you are not calling the function largestBST, also still it would give incorrect answer as your logic is incorrect,
take this tree


tree with root=6 is a BST ,
for tree at root = 5, right subtree is a BST, but still this tree(with root as 5) is not a BST.

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.