Can someone help me understanding the problem?
I am not clear on the path of the tree in this problem. Is the path meant to be one of tree traverse. Like level order, in , pre or post order traverse?
A path, in this problem, refers to any sequence of nodes from some starting node to any node in the tree along the parent-child connections. In the example, you start at either the 2 or 3, then traverse to its parent, the 1 at the root, then finish at the root's other child. That gives 2+1+3 = 3+1+2 = 6.
No, the path doesn't need to go through the root. Also, note that it can be just the 1 node as well.
1 **2** 1 10 10 1 1
If the tree is like the above, what is the answer?
Is it 10+2 + 10 = 22. or
left 22, right 3 and then 22 + 1 + 3 = 26?
if 26 is the case, path will across 2 if it want go to top?
@yin10 I have the same question. Can somebody please clarify.
@yin10 I think answer should be 22. If you use 22 then the path is already complete, no number can be added. Because you cannot let it go back to add another 10. It can only go in the same way.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.