Skip to content

Commit 4c3a58c

Browse files
Update word_break.py
1 parent 84c8f57 commit 4c3a58c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dynamic_programming/word_break.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def word_break(string: str, words: list[str]) -> bool:
6464
raise ValueError("the words should be a list of non-empty strings")
6565

6666
# Build trie
67-
trie: dict[str, dict[str, dict[str, Any] | bool]] = {}
67+
trie: dict[str, Any] = {}
6868
word_keeper_key = "WORD_KEEPER"
6969

7070
for word in words:
@@ -90,7 +90,7 @@ def is_breakable(index: int) -> bool:
9090
if index == len_string:
9191
return True
9292

93-
trie_node = trie
93+
trie_node: Any = trie
9494
for i in range(index, len_string):
9595
trie_node = trie_node.get(string[i], None)
9696

0 commit comments

Comments
 (0)