From: Christer Nilsson Date: 2005-12-14T01:11:39+09:00 Subject: Re: Array.invert Beautiful, thank you David and Michael. Must be hard to improve now! [David, Michael].merge : class Array def invert res = [] each_with_index do |e, i| e.each {|f| (res[f] ||= []) << i} if e end res end end Christer -- Posted via http://www.ruby-forum.com/.