Given a binary tree, write a program to find its maximum depth.

Problem Note

  • The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
  • A leaf is a node with no children.


Input: Given binary tree
   / \
  9  20
    /  \
   15   7
Output: return its depth = 3