Your question is Maximum Depth of Binary Tree. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given the root of a binary tree, return its maximum depth as an integer. The maximum depth is the number of nodes along the longest path from the root node down to any leaf node. If the tree is empty, return 0.
def max_depth(root=None, val=None, left=None, right=None):