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 =3D> 2
> b =3D> 3
> c =3D> 2
>
> So, to count number of occurences

>> arr =3D ["a", "b", "a", "c", "c", "b", "b"]
=3D> ["a", "b", "a", "c", "c", "b", "b"]
>> h =3D Hash.new(0) ; arr.each {|e| h[e] +=3D 1}; p h
{"a"=3D>2, "b"=3D>3, "c"=3D>2}
=3D> nil

Cheers,

--=20
JJ Fleck
PCSI1 Lyc=E9e Kl=E9ber