MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / maxPathSum

Function maxPathSum

binary_tree_maximum_path_sum_124/solution.go:10–14  ·  view source on GitHub ↗
(root *TreeNode)

Source from the content-addressed store, hash-verified

8var max int
9
10func maxPathSum(root *TreeNode) int {
11 max = math.MinInt32
12 maxPathSumHelper(root)
13 return max
14}
15
16func maxPathSumHelper(root *TreeNode) int {
17 if root == nil {

Callers 1

Test_maxPathSumFunction · 0.85

Calls 1

maxPathSumHelperFunction · 0.85

Tested by 1

Test_maxPathSumFunction · 0.68