You are given the root of a binary tree. Your task is to find and return the maximum depth of the tree. The maximum depth is the number of nodes along the longest path from the root to a leaf.
Input: root = [3,9,20,null,null,15,7]
Output: 3
Explanation: The longest root-to-leaf path contains 3 nodes.
Input: root = [1,null,2]
Output: 2
Explanation: The tree has two levels.
Input: root = []
Output: 0
Explanation: The tree is empty.
Sign in to write, run, and submit your solution against the full test suite.