Skip to content

Commit 4302af0

Browse files
Update combination_sum.py
1 parent 0c8ec83 commit 4302af0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backtracking/combination_sum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def combination_sum(candidates: list, target: int) -> list:
4747
>>> combination_sum([-8, 2.3, 0], 1)
4848
Traceback (most recent call last):
4949
...
50-
ValueError: All elements in candidates must be non-negative.
50+
ValueError: All elements in candidates must be non-negative
5151
>>> combination_sum([], 1)
5252
Traceback (most recent call last):
5353
...
@@ -57,7 +57,7 @@ def combination_sum(candidates: list, target: int) -> list:
5757
raise ValueError("Candidates list should not be empty")
5858

5959
if any(x < 0 for x in candidates):
60-
raise ValueError("All elements in candidates must be non-negative.")
60+
raise ValueError("All elements in candidates must be non-negative")
6161

6262
path = [] # type: list[int]
6363
answer = [] # type: list[int]

0 commit comments

Comments
 (0)