Skip to content

Commit e82eab9

Browse files
Update binary_tree_path_sum.py
1 parent d9ae152 commit e82eab9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

data_structures/binary_tree/binary_tree_path_sum.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,20 @@ class BinaryTreePathSum:
5656
0
5757
5858
The second tree looks like this
59-
0
60-
/ \
61-
5 5
59+
0
60+
/ \
61+
5 5
6262
6363
>>> tree2 = Node(0)
6464
>>> tree2.left = Node(5)
6565
>>> tree2.right = Node(15)
6666
6767
>>> BinaryTreePathSum().path_sum(tree2, 5)
68-
2
68+
1
6969
>>> BinaryTreePathSum().path_sum(tree2, -1)
7070
0
7171
>>> BinaryTreePathSum().path_sum(tree2, 0)
7272
1
73-
7473
"""
7574

7675
target: int

0 commit comments

Comments
 (0)