class StreamChecker: def __init__(self, words: 'List[str]'): self.maxLen = 0 self.List = set(words) for w in self.List: self.maxLen = max(self.maxLen,len(w)) self.STR = '' def query(self, letter: str) -> bool: if letter in self.List: return True else…