#trie
Read more stories on Hashnode
Articles with this tag
class TrieNode: def __init__(self): self.children = {} self.is_end_of_word = False class Trie: def __init__(self): ...
class Solution: def replaceWords(self, dictionary: List[str], sentence: str) -> str: roots = set(dictionary) ans = "" ...