<doocs>0110.Balanced Binary Tree_1.py
def height(root):
    if root is None:
        return 0
    l, r = height(root.left), height(root.right)
    if l == -1 or r == -1 or abs(l - r) > 1:
        return -1
    return 1 + max(l, r)
def sample_funcname ( var_1 ) :
    if var_1 is None :
        return 0
    var_5 , var_7 = var_0 ( var_1.left ) , var_0 ( var_1.right )
    if var_5 == - 1 or var_7 == - 1 or abs ( var_5 - var_7 ) > 1 :
        return - 1
    return 1 + max ( var_5 , var_7 )
