On Thu, Jul 21, 2011 at 3:27 PM, CC Chen <dickyhide / gmail.com> 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