solution.py
⌘↵ runLoading...
Maximum Depth of Binary Tree
easyYou've got this! Start small, think out loud.
Given the root of a binary tree, return its maximum depth. The maximum depth is the number of nodes along the longest path from the root down to the farthest leaf.
Time:O(n)
Space:O(h)
recursiondfsgoogle-favorite
OUTPUT
Run your code to see output