public class Solution {
public int cur=0;
public int maxDepth(TreeNode root) {
if(root==null){
return cur;
}
cur++;
int left=maxDepth(root.left);
int right=maxDepth(root.right);
cur--;
return left>right?left:right;
}
}
08-17
08-17
08-17
08-17