Problem 1044 · Hard

Longest Duplicate Substring

Binary search the length, and use a rolling hash to find two equal windows of that length, checking each hash hit against the text.

Open the interactive visualisation