Try following :

irb(main):035:0> k = [9, 9, 6, 0, 1, 4, 5, 6, 9, 1, 9]
=> [9, 9, 6, 0, 1, 4, 5, 6, 9, 1, 9]

irb(main):034:0> k.each_with_index.collect{|t,i| i if t == 
k.max}.compact
=> [0, 1, 8, 10]

Esha

-- 
Posted via http://www.ruby-forum.com/.