Given the root of a binary tree, return its maximum depth (the number of nodes on the longest root-to-leaf path).
Input: root = [3,9,20,null,null,15,7]
Output: 3
Topics: trees, recursion
Asked by: Amazon, Google, Meta, Microsoft, Apple
Time complexity: O(n). Space complexity: O(h).