A path in a binary tree is a sequence of nodes where each consecutive pair of nodes is connected by an edge. Each node can appear in the sequence no more than once. The path does not necessarily need to pass through the root.
The sum of a path is the total value of the nodes along the path.
Given the root of a binary tree, return the maximum sum of any non-empty path in the tree.
leetcode
A path in a binary tree is a sequence of nodes where each consecutive pair of nodes is connected by an edge. Each node can appear in the sequence no more than once. The path does not necessarily need to pass through the root.
The sum of a path is the total value of the nodes along the path.
Given the root of a binary tree, return the maximum sum of any non-empty path in the tree.
leetcode