<doocs>1740.Find Distance in a Binary Tree_2.py
def lca(root, p, q):
    if root is None or root.val in [p, q]:
        return root
    left = lca(root.left, p, q)
    right = lca(root.right, p, q)
    if left is None:
        return right
    if right is None:
        return left
    return root
def sample_funcname ( var_1 , var_2 , var_3 ) :
    if var_1 is None or var_1.val in [ var_2 , var_3 ] :
        return var_1
    left = var_0 ( var_1.left , var_2 , var_3 )
    right = var_0 ( var_1.right , var_2 , var_3 )
    if left is None :
        return right
    if right is None :
        return left
    return var_1
