BWT by rickrickrick

for l in io.lines()do p={l}for i=2,#l do p[i]=l:sub(i)..l end table.sort(p)s=" "for i=1,#l do v=p[i]p[v]=i-1 s=s..v:sub(#l,#l)end print(p[l]..s)end

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

download

return to the top page