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 2fd7637 commit c3a70d8Copy full SHA for c3a70d8
design-add-and-search-words-data-structure/taurus09318976.py
@@ -22,7 +22,7 @@ def __init__(self):
22
self.root = TrieNode()
23
24
# 단어를 문자별로 트라이에 추가
25
- def addWord(self, word: str) -> None:
+ def addWord(self, word: str):
26
node = self.root
27
for char in word:
28
if char not in node.children:
@@ -33,7 +33,7 @@ def addWord(self, word: str) -> None:
33
node.is_end = True
34
35
# 깊이 우선 탐색(dfs)함수로 재귀적 탐색.
36
- def search(self, word: str) -> bool:
+ def search(self, word: str):
37
def dfs(node, index):
38
if index == len(word):
39
return node.is_end
0 commit comments