Longest repeating substring
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) -> strExample 1
Input
longest_dup_substring("banana")Output
"ana"