Let's say we have given 2 strings $A, B$, and let's suppose that the size of $A$ is pretty small (100 characters) and the size of $B$ is pretty big (1 million).
We define prefix of string $S$ as string $Y$ that contains the first $x$ letters (size of prefix always is less than or equal to size of whole string).
And the problem is to check for all prefixes of $A$, they are not too many if they are substrings of string $B$.
It is pretty slow if for each prefix we are traversing the whole string, is it possible to do something faster, maybe using string hasing?