Given the root of a binary tree, return its maximum depth — the number of nodes along the longest path from the root node down to the farthest leaf node.
root = [3,9,20,null,null,15,7]3root = [1,null,2]2root == null → return 0 (null node has depth 0)L = maxDepth(root.left)R = maxDepth(root.right)1 + Math.max(L, R) — this node adds 1 to the deeper subtreePost-order (left → right → root) processes children before the parent. By the time we ask "what is the depth of this node?", both subtree depths are already known. The depth of any node is simply 1 (for itself) + the deeper of its two subtrees. This naturally bubbles the answer up from leaves (depth 1) to the root. The call stack is the recursion — as it unwinds, values propagate back up.