You are viewing a single comment's thread. Return to all comments →
Cleaned up a little:
while root: if v1<root.info and v2<root.info: root=root.left elif v1>root.info and v2>root.info: root=root.right else: return root
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Binary Search Tree : Lowest Common Ancestor
You are viewing a single comment's thread. Return to all comments →
Cleaned up a little: