2010/7/20 Vitaliy Yanchuk <fuksito / gmail.com>: > Jean-Julien Fleck, thanks. > Maybe have an idea of a one-line version? :) Well: quite the same using inject: arr.inject(Hash.new(0)) {|h,e| h[e]+= 1; h} It all depends on what you call 'one-line' :o) Cheers, -- JJ Fleck PCSI1 LycñÆ KlñÃer