question: private int maxDepth ( TreeNode root ) { if ( root == null ) return 0 ; int left = maxDepth ( root . left ) ; int right = maxDepth ( root . right ) ; if ( left == - 1 || right == - 1 || Math . abs ( left - right ) > 1 ) return - 1 ; return Math . max ( left , right ) + 1 ; }
target:  Modification of max depth If current node is null, return 0 Compare left depth with right depth If the difference is bigger than 1, set isBalance false Otherwise go on to the rest of the nodes