Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Double Substring by yoichi
def double_substring(line):
"""length of the longest substring that non-overlapping repeats more than once."""
for i in range(len(line), 0, -1):
for j in range(len(line) - i + 1):
substr = line[j:j+i]
if substr in line[j+i:]:
return len(substr)
return 0
Aug. 23, 2017