From: Harry Kakueki Date: 2011-07-29T03:52:59+09:00 Subject: Re: array max value On Thu, Jul 21, 2011 at 3:27 PM, CC Chen wrote: > When I set an array k = [3,5,6,0,1,4,5,6,9,1] > > And I used the k.max can know the max value is 9 > > How do I get the number "8" (as k[8] = 9)?? > > > k = [3,5,6,0,1,4,5,6,9,1,9] m,s = k.max,k.size p (0...s).select{|x| k[x]==m} Not as easy to make a goofy story out of this one :) Harry