Skip to content

Commit 8483061

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 332c6fe commit 8483061

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backtracking/word_break.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def backtrack(input_string: str, word_dict: set[str], start: int) -> bool:
3737

3838
# Try every possible substring from 'start' to 'end'
3939
for end in range(start + 1, len(input_string) + 1):
40-
if input_string[start:end] in word_dict and backtrack(input_string, word_dict, end):
40+
if input_string[start:end] in word_dict and backtrack(
41+
input_string, word_dict, end
42+
):
4143
return True
4244

4345
return False

0 commit comments

Comments
 (0)