(TreeNode root)
| 13 | */ |
| 14 | public class Solution { |
| 15 | public int maxDepth(TreeNode root) { |
| 16 | if (root == null) return 0; |
| 17 | return 1 + Math.max(maxDepth(root.left), maxDepth(root.right)); |
| 18 | } |
| 19 | |
| 20 | public static void main(String[] args) { |
| 21 | Solution solution = new Solution(); |