public int returnHight(TreeNode root) {
        if (root == null){
            return 0;
        }
        int hLeft = returnHight(root.left);
        int hRight = returnHight(root.right);
        if (hLeft-hRight<-1||hLeft-hRight>1||hLeft==-2||hRight==-2){
            return -2;
        }
        else {
            return (hLeft>hRight?hLeft:hRight)+1;
        }
    }