力扣(LeetCode)官网 - 全球极客挚爱的技术成长平台
function maxDepth(root: TreeNode | null): number {
return root ? Math.max(maxDepth(root.left), maxDepth(root.right)) + 1 : 0;
};
力扣(LeetCode)官网 - 全球极客挚爱的技术成长平台
function maxDepth(root: TreeNode | null): number {
return root ? Math.max(maxDepth(root.left), maxDepth(root.right)) + 1 : 0;
};