Reverse BWT by murky-satyr

while''do
n,s=io.read():match("(%d+).(.+)")p={}for m=1,#s do
for i=1,#s do p[i]=s:sub(i,i)..(p[i]or"")end
table.sort(p)end
print(p[n+1])end

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

download

return to the top page