Given the root of a binary tree, find the root-to-leaf path with the most nodes and return the sum of values along it. If two paths tie for the most nodes, return the larger sum. An empty tree has sum 0. The tree is given as a level-order array.
Input: A level-order array of the tree.
Output: Integer — the sum along the longest root-to-leaf path.
Input: [1,2,3,4,5,null,6,7]
Output: 14
Explanation: Longest path 1-2-4-7 sums to 14.Input: [1]
Output: 1
Explanation: Single node.Input: []
Output: 0
Explanation: Empty tree.0<=nodes<=10^4-1000<=value<=1000