A path is any sequence of adjacent nodes (each node used at most once) — it need not pass through the root or reach a leaf. Return the maximum possible sum of values along any non-empty path.
Input: one line — the tree in level order. Output: the maximum path sum.
1 2 3
6
2 → 1 → 3.
-10 9 20 null null 15 7
42
15 → 20 → 7.
Run your code against the sample tests, or Submit to run the full suite.