from collections import * from LowestCommonAncestor import * def find(root, value): current_node = root while current_node: if current_node.data == value: return current_node elif value < current_node.data: current_node = current_node.left else: current_node = current_node.right return None def main(root, input2, input3): lca = lowest_common_ancestor(root, find(root, input2), find(root, input3)) if lca: return lca.data return -1