a#b=last$0:[c|c<-a,b==filter(/=c)a]f=maximum.map((\s->[s!!0..last s]#s).map read.words.concat).mapM(\c->[[c],c:" "]) main = print $ map f ["99101"]
Standard input is empty
[100]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!