Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
blankplank's version, modified solution in Speedy category for Double Substring by Phil15
def double_substring(line):
length = start = 0
for end in range(1, len(line) + 1):
if line[start:end] not in line[end:]:
start += 1
elif end - start > length: # We have a candidate, is it longer than the previous one.
length = end - start
return length
April 21, 2022
Comments: