From an onsite
Given a binary tree, find the maximum path sum from any two "alive nodes" within the tree. We can assume a node is an alive node if and only if it is a leaf node, indicated by an asterisk below.
5
/ \
2 0
/ / \
*25 *14 *1547 = 25 + 2 + 5 + 15
Follow - up
What if any nodes in the tree can be alive instead of just the leaves?