Problem 3037 · Medium

Find Pattern in Infinite Stream II

Build a failure table for the pattern, then follow the bit stream with one matched-prefix state; a mismatch falls back through the table instead of rereading bits.

Open the interactive visualisation