Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
8-liner: easy solution in Clear category for Long Repeat Inside by przemyslaw.daniel
def repeat_inside(string):
from itertools import product
result, R = '', range(len(string))
for i, j, k in product(R, R, R):
pattern = string[i:j]*(k+2)
if string.count(pattern):
result = max(result, pattern, key=len)
return result
Aug. 20, 2017
Comments: