Word frequency count FIXED by niha

a=gets(p).downcase.tr("^a-z ","").split
(a.sort|a).map{|n|puts"#{a.grep(n).size} "+n}

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

download

return top