Longest duplicated substring

0
Remix

Return any longest substring that occurs at least twice in a string (the occurrences may overlap), or an empty string if none does. Binary search on the length with a rolling hash, or use a suffix array, and handle hash collisions.

GoogleTechnical phone screenLast asked Dec 2025
No answer yet. Write the first one; the best answer gets endorsed.