Hello, > Would be grateful if someone can tell, how can I do shortly (mb with one > method) from such example array > > ["a", "b", "a", "c", "c", "b", "b"] > > The result > a => 2 > b => 3 > c => 2 > > So, to count number of occurences >> arr = ["a", "b", "a", "c", "c", "b", "b"] => ["a", "b", "a", "c", "c", "b", "b"] >> h = Hash.new(0) ; arr.each {|e| h[e] += 1}; p h {"a"=>2, "b"=>3, "c"=>2} => nil Cheers, -- JJ Fleck PCSI1 LycñÆ KlñÃer