Skip to content

Commit ed46c53

Browse files
committed
Organized imports
1 parent c31fc3f commit ed46c53

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

data_structures/binary_tree/binary_tree_maximum_path_sum.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
"""
2-
A path in a binary tree is a sequence of nodes where each pair
3-
of adjacent nodes in the sequence has an edge connecting
4-
them. A node can only appear in the sequence at most once. Note
5-
that the path does not need to pass through the root.
6-
7-
The path sum of a path is the sum of the node's values in the path.
8-
9-
Given the root of a binary tree, return the maximum path sum of any non-empty path.
10-
11-
Leetcode Reference : https://leetcode.com/problems/binary-tree-maximum-path-sum/
12-
"""
131
from __future__ import annotations
2+
143
from dataclasses import dataclass
154

165

6+
# Leetcode Reference : https://leetcode.com/problems/binary-tree-maximum-path-sum/
177
@dataclass
188
class TreeNode:
199
val: int
@@ -57,7 +47,7 @@ class GetMaxPathSum:
5747
29
5848
"""
5949

60-
def __init__(self, root) -> None:
50+
def __init__(self, root: TreeNode) -> None:
6151
self.sum = -9999999999
6252
self.root = root
6353

@@ -126,4 +116,3 @@ def construct_tree() -> TreeNode:
126116
print("Given example output: ", max_sum)
127117

128118
doctest.testmod()
129-

0 commit comments

Comments
 (0)