As far as i've understood the problem my solution should be correct please help
@akshitmehta hey,you have not consider the case whether subtree is bst or not in recursion for that take bool variable which tells whether tree is bst or not and check condition for every left and right subtree of node.Hope you get it
when i’m returning pair . first is for current ongoing streak and second is for maximum bst that has occures in left subtree or right subtree
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.