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.
@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.