From: Benoit Daloze Date: 2010-09-13T03:10:35+09:00 Subject: Re: Key Associated w/ Maximum Value in Hash On 12 September 2010 18:29, Douglas Seifert wrote: > For fun: > http://www.pastie.org/1153968 > To keep the fun going :) http://gist.github.com/576279 I wonder why nobody used Enumerable#max_by or Hash#key (#index in 1.8): HASH.max_by(&:last).first HASH.key HASH.values.max And it reveals there are both relatively efficient. I could not help to DRY a bit the tests ;) Regards, B.D.