Problem 3879 · Hard

Maximum Distinct Path Sum in a Binary Tree

Grow simple paths from every node, refuse any path that repeats a value, and keep the largest sum.

Open the interactive visualisation