BWT by murky-satyr

D:=Dictionary new.
stdin linesDo:[:x|A:=SortedCollection sortBlock:[:a :b|(D at:a)<(D at:b)].1to:(L:=x size)do:[:i|D add:(S:=x,x copyFrom:i to:i+L- 1)->(#[],S fold:[:x :y|x*128+y]).A add:S].stdout<<((A indexOf:x)- 1)<<(' ',(A collect:[:v|v last]));nl]

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

download

return to the top page