class Solution {
public int maxDepth(Node root) {
if(root == null) return 0;
int res = 0;
for(Node i:root.children){
res = Math.max(maxDepth(i),res);
}
return res + 1;
}
}
559. N 叉树的最大深度
N叉树的最大深度计算
最新推荐文章于 2025-12-09 16:25:48 发布
285

被折叠的 条评论
为什么被折叠?



