Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Double Substring by m.kurapov
def double_substring(line):
"""
length of the longest substring that non-overlapping repeats more than once.
"""
longest = 0
len_line = len(line)
for i in range(len_line):
while i+longest*2 < len_line and line.count(line[i:i+longest+1]) > 1:
longest += 1
return longest
Feb. 18, 2020