Reverse BWT by niha

#!ruby -na
n,$_=$F
s=split""
a=s.sort.map{|c|sub c," ";$`.size}
puts s.map{s[n=a[n.to_i]]}*""

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

download

return top