MCPcopy Index your code
hub / github.com/BeeBombshell/Python-DSA / maxPathSum

Method maxPathSum

Tree Data Structure/binarytree_maxpath.py:34–37  ·  view source on GitHub ↗
(self, root)

Source from the content-addressed store, hash-verified

32 return Tree
33class Solution(object):
34 def maxPathSum(self, root):
35 self.ans = -float('inf')
36 self.solve(root)
37 return self.ans
38 def solve(self,node):
39 if not node or node.data == 0:
40 return 0

Callers 1

Calls 1

solveMethod · 0.95

Tested by

no test coverage detected