Concept Flow - DP on Trees Maximum Path Sum
Start at root node
Recursively compute max path sum from left subtree
Recursively compute max path sum from right subtree
Calculate max path through current node: max(left,0) + node.val + max(right,0)
Update global max if current path sum is higher
Return max path sum including current node and one subtree
Repeat for all nodes
Final global max is the answer
We start at the root and recursively find max path sums from left and right children. At each node, we calculate max path sum passing through it and update the global max. We return max sum including the node and one subtree to parent.