root of a binary tree. Find the nodes that lie farthest from the root and return the sum of their values.root=tree_node([3, 9, 20, None, None, 15, 7]) → 22
The deepest level is level 2, holding 15 and 7. Their sum is 22.
root=tree_node([4, None, 8, 2, 5]) → 7
The root has only a right child 8, whose children are 2 and 5. They are the deepest: 2 + 5 = 7.
root=tree_node([10]) → 10
The only node is the deepest level by itself.
root=tree_node([3, 9, 20, None, None, 15, 7])
22
Run checks the first 3 tests in your browser. Submit checks all 98 tests on the server, hidden ones included.