From: Hans Mackowiak Date: 2012-10-11T02:30:44+09:00 Subject: Re: How to create an Array in a Hash 1) this line replaces all your other posted lines. so you have this: anagram_array = words.uniq.group_by{|w| w.downcase.each_char.sort}.values 2) uniq removes the second scream group_by wants a block w.downcase.each_char.sort makes an array of chars so "Cars" will be turned to ["a","c","r","s"] so we have: { ["a", "c", "r", "s"]=>["cars", "scar"], ["f", "o", "r", "u"]=>["four"], ["a", "c", "e", "m", "r", "s"]=>["creams", "scream"] } but you only want the values, so i add .values -- Posted via http://www.ruby-forum.com/.