Skip to content

Commit 8b54a26

Browse files
Update sum_of_subsets.py
1 parent ecfaf99 commit 8b54a26

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

backtracking/sum_of_subsets.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,16 @@ def create_state_space_tree(
4747
>>> path = []
4848
>>> result = []
4949
>>> create_state_space_tree(
50-
... nums=[1], max_sum=1, num_index=0, path=path, result=result, remaining_nums_sum=1)
50+
... nums=[1],
51+
... max_sum=1,
52+
... num_index=0,
53+
... path=path,
54+
... result=result,
55+
... remaining_nums_sum=1)
5156
>>> path
5257
[]
5358
>>> result
54-
[]
59+
[[1]]
5560
"""
5661

5762
if sum(path) > max_sum or (remaining_nums_sum + sum(path)) < max_sum:

0 commit comments

Comments
 (0)