Skip to content

Commit

Permalink
dec 1
Browse files Browse the repository at this point in the history
  • Loading branch information
alainlou committed Dec 1, 2020
1 parent b331df7 commit d9ec918
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions p104.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from DS.TreeNode import TreeNode

class Solution:
def maxDepth(self, root: TreeNode) -> int:
if root == None:
return 0
return 1 + max(self.maxDepth(root.left), self.maxDepth(root.right))

0 comments on commit d9ec918

Please sign in to comment.