Problem 1392 · Hard

Longest Happy Prefix

Find the longest proper prefix that is also a suffix, using the prefix function to reuse matched lengths.

Open the interactive visualisation