@@ -12,7 +12,7 @@ def __init__(self):
12
12
self .nodes = dict () # Mapping from char to TrieNode
13
13
self .is_leaf = False
14
14
15
- def insert_many (self , words : [str ]):
15
+ def insert_many (self , words : [str ]): # noqa: F821 This syntax is Python 3 only
16
16
"""
17
17
Inserts a list of words into the Trie
18
18
:param words: list of string words
@@ -21,7 +21,7 @@ def insert_many(self, words: [str]):
21
21
for word in words :
22
22
self .insert (word )
23
23
24
- def insert (self , word : str ):
24
+ def insert (self , word : str ): # noqa: F821 This syntax is Python 3 only
25
25
"""
26
26
Inserts a word into the Trie
27
27
:param word: word to be inserted
@@ -34,7 +34,7 @@ def insert(self, word: str):
34
34
curr = curr .nodes [char ]
35
35
curr .is_leaf = True
36
36
37
- def find (self , word : str ) -> bool :
37
+ def find (self , word : str ) -> bool : # noqa: F821 This syntax is Python 3 only
38
38
"""
39
39
Tries to find word in a Trie
40
40
:param word: word to look for
@@ -48,7 +48,7 @@ def find(self, word: str) -> bool:
48
48
return curr .is_leaf
49
49
50
50
51
- def print_words (node : TrieNode , word : str ):
51
+ def print_words (node : TrieNode , word : str ): # noqa: F821 This syntax is Python 3 only
52
52
"""
53
53
Prints all the words in a Trie
54
54
:param node: root node of Trie
0 commit comments