diff options
Diffstat (limited to 'bt_max_path_sum.cpp')
-rw-r--r-- | bt_max_path_sum.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bt_max_path_sum.cpp b/bt_max_path_sum.cpp index 7be19b2..ff39808 100644 --- a/bt_max_path_sum.cpp +++ b/bt_max_path_sum.cpp @@ -1,5 +1,15 @@ +// 124. Binary Tree Maximum Path Sum #include "leetcode.h" +/* + * a path in a binary tree is a sequence of nodes where each pair of adjacent + * nodes in the sequence has an edge connecting them. a node can only appear in + * the sequence at most once. note that the path does not need to pass through + * the root. the path sum of a path is the sum of the node's value in the path. + * given the 'root' of a binary tree, return the maximum path sum of any non + * empty path + */ + class Solution { public: int sum; |