Maximum Path Sum from Leaf to Leaf
Hard

Problem Statement

Find the maximum sum path between any two leaf nodes in a binary tree.

Examples

1Example 1
Input:
{ "root": [ 3, 4, 5, -10, 4 ] }
Output:
16
2Example 2
Input:
{ "root": [ -15, 5, 6, -8, 1, 3, 9, 2, 6, null, null, 0, 4, -1, 10 ] }
Output:
32
3Example 3
Input:
{ "root": [ 1, 2, 3 ] }
Output:
6
Loading...

Sign in to Run Code and Submit