Longest Repeated Substring FIXED by clock

#!ruby -pl
i=0
T=$1while$_*2=~/(.{#{i+=1}}).{#{~/$/-i}}.+\1/
$_=T

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top