Java Solution without calculating height


#1
 public int isBalanced(TreeNode root){
        if( root == null){
            return 1;
        }

        if( root.left == null && (root.right != null && (root.right.right != null || root.right.left != null))){
            return 0;
        }

        if( root.right == null && (root.left != null && (root.left.right != null || root.left.left != null))){
            return 0;
        }
        return Math.min(isBalanced(root.left), isBalanced(root.right));
    }

#2

why Math.min(isBalanced(A.left), isBalanced(A.right))


#3

15 1 2 2 3 3 -1 -1 4 4 -1 -1 -1 -1 -1 -1
try this testcase ,you will get a wrong answer.