(self, word: str)
| 15 | Inserts the string word into the trie. |
| 16 | """ |
| 17 | def insert(self, word: str) -> None: |
| 18 | curr = self.root |
| 19 | for c in word: |
| 20 | if c not in curr.children: |
| 21 | curr.children[c] = TrieNode() |
| 22 | curr = curr.children[c] |
| 23 | curr.is_end = True |
| 24 | |
| 25 | """ |
| 26 | Returns true if the string word is in the trie (i.e., was inserted before). |
no test coverage detected