yeonghwanjeon / coding_practice

0 stars 0 forks source link

[LeetCode]Maximum depth of binary tree (완료) #41

Open yeonghwanjeon opened 5 years ago

yeonghwanjeon commented 5 years ago

class Solution(object): def maxDepth(self, root): """ :type root: TreeNode :rtype: int """ if root is None : return 0

    return max(self.maxDepth(root.left), self.maxDepth(root.right)) + 1