Search⌘ K
AI Features

Stream of Characters

Explore how to design and implement a custom data structure called StreamChecker that processes a stream of characters and efficiently checks if any suffix matches the provided list of words. This lesson helps you understand the problem constraints, develop a clear solution strategy, and practice coding the solution interactively, reinforcing your skills in handling streaming data and suffix matching challenges.

Statement

Design a data structure that processes a stream of characters and, after each character is received, determines if a suffix of these characters is a string in a given array of strings words.

For example, if words = ["dog"] and the stream adds the characters ‘d’, ‘c’, ‘a’\text{`d', `c', `a'}, and ‘t’\text{`t'} ...