Find most common string in an array

Posted by j. on Stack Overflow See other posts from Stack Overflow or by j.
Published on 2010-04-01T17:19:28Z Indexed on 2010/04/01 17:23 UTC
Read the original article Hit count: 226

Filed under:
|
|

I have this array, for example (the size is variable):

   x = ["1.111", "1.122", "1.250", "1.111"]

and I need to find the most commom value ("1.111" in this case).

Is there an easy way to do that?

Tks in advance!

© Stack Overflow or respective owner

Related posts about ruby

Related posts about array