Given a binary tree, write a program to find the maximum depth of the binary tree.
Problem Note
- The maximum depth is the number of nodes along the longest path from the root node to leaf node.
- A leaf is a node with no child nodes.
Example
Input: Given binary tree,
[5, 3, 6, 2, 4, -1, -1, 1, -1, -1, -1, -1, -1]
5
/ \
3 6
/ \
2 4
/
1
Output: return its depth = 4