Given the root of a binary tree, return its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
Example 1:
3
/ \
9 20
/ \
15 7
Input: root = [3,9,20,null,null,15,7] Output: 3 Explanation: The longest root-to-leaf path has 3 nodes: 3 -> 20 -> 15 (or 3 -> 20 -> 7).
Example 2:
Input: root = [1,null,2] Output: 2 Explanation: The only leaf is node 2; reached via a path of length 2 from the root.
[0, 10^4].-100 <= Node.val <= 100root = [3,9,20,null,null,15,7]