Skip to main content
πŸ”’ Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial β†’
⚑
← Coursesβ€ΊInterview PrepModule 3 Β· Trees, Graphs, BFS/DFS Β· Recapβ€ΊπŸŽ― Review: Interview Prep module 3 recapscenario42 / 104
+80 XP
Task
Build `tree_max_depth(node)` over a nested-dict binary tree: - A node is `{"value": N, "left": <node or None>, "right": <node or None>}`. - `None` β†’ depth 0 (empty tree). - Single root β†’ depth 1. - Otherwise β†’ `1 + max(depth(left), depth(right))`. This is LeetCode #104 β€” the cleanest demonstration of "base case + combine" tree recursion.
✏️ Write your code here
🐍
Loading Python...
One-time download (~1 MB). Then it runs instantly.
πŸ“Š Result
Press Run to see result...

πŸ’¬ Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…