Problem 124 · Hard

Binary Tree Maximum Path Sum

DFS returns the best single-branch gain; a global max tracks the best path through each node.

Open the interactive visualisation