import List m@main=do s<-getLine;putStrLn$show(sum[1|x<-g s,x<s])++' ':map last(g s);m g s=sort$scanr(\_(a:x)->x++[a])s$tail s
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page