Problem 124 · Hard
DFS returns the best single-branch gain; a global max tracks the best path through each node.
Open the interactive visualisation