We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fcf82a1 commit 7c4ddc6Copy full SHA for 7c4ddc6
data_structures/binary_tree/binary_tree_path_sum.py
@@ -50,6 +50,26 @@ class BinaryTreePathSum:
50
>>> tree.right.right = Node(10)
51
>>> BinaryTreePathSum().path_sum(tree, 8)
52
2
53
+ >>> BinaryTreePathSum().path_sum(None, 0)
54
+ 0
55
+ >>> BinaryTreePathSum().path_sum(tree, 0)
56
57
+
58
+ The second tree looks like this
59
60
+ >>> tree2 = Node(0)
61
+ >>> tree2.left = Node(5)
62
+ >>> tree2.right = Node(5)
63
64
+ / \
65
+ 5 5
66
+ >>> BinaryTreePathSum().path_sum(tree, 5)
67
+ 2
68
+ >>> BinaryTreePathSum().path_sum(tree, -1)
69
70
71
+ 1
72
73
"""
74
75
target: int
0 commit comments