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 ...prefix-treeAdd a thoughtful commentNo comments yetBe the first to start the conversation.