Longest repeating substring

Write codeHard40 minGoogle style

Your task

Given a lowercase string s, return the longest substring that appears at least twice in s (occurrences may overlap). If none repeats, return the empty string. For 'banana' the answer is 'ana'. If multiple longest answers exist, returning any one of them is acceptable. Length up to a few thousand.

Examples

longest_dup_substring(s: str) -> str
Example 1
Inputlongest_dup_substring("banana")
Output"ana"