https://leetcode.com/problems/maximum-depth-of-binary-tree/
최대 깊이를 리턴해야 하는 문제다.
재귀로 left, right 돌려서 둘 중 큰 값에 + 1하면 된다.
class Solution {
public int maxDepth(TreeNode root) {
if (root == null) return 0;
return Math.max(maxDepth(root.left), maxDepth(root.right)) + 1;
}
}