3min鹏氧,一次過
class Solution:
def maxDepth(self, root: TreeNode) -> int:
if not root:return 0
return max(self.maxDepth(root.left),self.maxDepth(root.right))+1
3min鹏氧,一次過
class Solution:
def maxDepth(self, root: TreeNode) -> int:
if not root:return 0
return max(self.maxDepth(root.left),self.maxDepth(root.right))+1