class Solution(object): def spellchecker(self, wordlist: 'List[str]', queries: 'List[str]') -> 'List[str]': wordlen = len(wordlist) wordict = {}#存原始形式 wordict_lowercase = {}#存小写形式 wordict_replace = {}#存替换形式 for i in range(wordlen): word = wordlist[i]…