BWT by moriA

import List
m@main=getLine>>=putStrLn.f>>m
l=length
f x=show(l[n|n<-h x,n<x])++' ':map(!!(l x-1))(h x)
h x=sort$take(l x)$tails$x++x

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

download

return to the top page