Problem 1062 · Medium

Longest Repeating Substring

Find the longest substring that appears twice, where the two copies may overlap, by growing matches along diagonals of a pair table.

Open the interactive visualisation