(self, word: str)
| 12 | self.data = {} |
| 13 | |
| 14 | def add(self, word: str): |
| 15 | if not word: |
| 16 | # Prevent empty string |
| 17 | return |
| 18 | ref = self.data |
| 19 | for char in word: |
| 20 | ref[char] = char in ref and ref[char] or {} |
| 21 | ref = ref[char] |
| 22 | ref[""] = 1 |
| 23 | |
| 24 | def split(self, text: str) -> List[str]: |
| 25 | states = OrderedDict() |
no outgoing calls
no test coverage detected