Stream suffix word matcher

Write codeHard35 min

Your task

You build a matcher from a list of lowercase words, then feed it characters one at a time via a stream. After each character, return whether any of the stored words is a suffix of the characters received so far. Implement a single function that takes the word list and a string of streamed characters, and returns a list of booleans (one per streamed character). Words and stream up to a few thousand characters total.

Examples

stream_suffix_match(words: list[str], stream: str) -> list[bool]
Example 1
Inputstream_suffix_match(["cd", "f"], "abcd")
Output[False, False, False, True]