Subject: Re: mode
From: "Kroeger, Simon (ext)" <simon.kroeger.ext siemens.com>
Date: Tue, 6 Jun 2006 23:27:02 +0900
In-reply-to: 196107
> another one:
>
> li.sort_by{|x| li.select{|y| x==y}.length}.last
even better (if === does what you expect)
li.sort_by{|x|li.grep(x).size}.last
> cheers
>
> Simon