7stud -- wrote:
> And this seems conceptually easier and it's slightly faster(if I 
> benchmarked it correctly):
> 
> input = gets
> h = Hash.new(0)
> 
> input.scan(/[a-z]/){|char| h[char] += 1}
> p h.sort


Whoops.  I didn't downcase the input in that example, but I did downcase 
the input in the benchmark tests.  In any case, apologies to Rick 
Denatale who already posted that solution.
-- 
Posted via http://www.ruby-forum.com/.