Tapan Rachchhtapanrachchh.hashnode.dev·Jun 7, 2024648. Replace Wordsclass Solution: def replaceWords(self, dictionary: List[str], sentence: str) -> str: roots = set(dictionary) ans = "" cache = {} for word in sentence.split(" "): temp = "" found = False ...Discussprefix-tree