text: # DFS
  # if not root, return ?
  # How to call ifself?
  # What to return?
  # Time: O(n)
  # Space: O(h), h is the height of binary tree
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  class TreeNode:
      def __init__(self, val=0, left=None, right=None):
          self.val = val
          self.left = left
          self. right = right
  
  
  class Solution:
      def maxDepth(self, root):
          if not root:
              return 0
          dep = 1 + max(self.maxDepth(root.left), self.maxDepth(root.right))
          return dep
  
  
  if __name__ == "__main__":
      l1 = TreeNode(3)
      l2 = TreeNode(9)
      l3 = TreeNode(20)
      l4 = TreeNode(15)
      l5 = TreeNode(7)
      l1.left = l2
      l1.right = l3
      l3.left = l4
      l3.right = l5
      s = Solution()
      print(s.maxDepth(l1))
  