Problem 2781 · Hard

Length of the Longest Valid Substring

Slide a window to the right and move its left edge past every forbidden string that ends at the current letter.

Open the interactive visualisation