Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
meh solution in Clear category for Long Repeat Inside by Leonix
def repeat_inside(line):
return max(candidates(line), key=len, default='')
def candidates(line):
for length in range(1, 1 + len(line)//2):
for count in range(2, 1 + len(line)//length):
for start in range(0, 1 + len(line) - length*count):
if 1 == len(set(line[i:i+length] for i in range(start, start+length*count, length))):
yield line[start:start+length*count]
July 9, 2019
Comments: