01 · Question
Given the root of a binary tree, return its maximum depth.
02 · Solution
1def maxDepth(root: Optional[TreeNode]) -> int:2 if not root:3 return 04 return 1 + max(maxDepth(root.left), maxDepth(root.right))