BWT by rickrickrick

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

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

download

return to the top page