Depth of the deepest leaf
Write max_depth(root): given the root of a binary tree, return how many nodes lie on the longest path from the root down to a leaf. An empty tree (None) has depth 0 and a single node has depth 1. Each TreeNode has val, left and right.
The tests call the provided run_max_depth(values), where values lists the tree level by level with null for a missing child: [1, null, 2, 3] is a root 1 with only a right child 2, whose left child is 3.
Examples
run_max_depth([8,3,10,null,6,9])→3run_max_depth([1,null,2,3])→3run_max_depth([])→0