Stream of Characters
Explore how to implement a custom data structure in JavaScript that processes a stream of characters and efficiently checks if any suffix matches a predefined list of words. Learn to apply this pattern for solving complex string matching problems in coding interviews.
We'll cover the following...
We'll cover the following...
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