Maximum Depth of N-ary Tree
给一个n叉树, 返回最深的depth.
class Solution {
public int maxDepth(Node root) {
if(root == null)
return 0;
int res = 0;
for(Node n : root.children) {
res = Math.max(res, maxDepth(n));
}
return res+1;
}
}