Maximum Depth of Binary Tree

Given the root of a binary tree, return the maximum depth, which is the number of nodes on the longest path from the root to any leaf (not the number of edges). The tree is given as a level-order array: null marks a missing child, trailing null entries are optional, and [] means an empty tree.

Examples
Input: [3,9,20,null,null,15,7]
Output: 3
Hints

Maximum Depth of Binary Tree

Given the root of a binary tree, return the maximum depth, which is the number of nodes on the longest path from the root to any leaf (not the number of edges). The tree is given as a level-order array: `null` marks a missing child, trailing `null` entries are optional, and `[]` means an empty tree.