Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
7 lines (6 sloc) 202 Bytes
def combine_anagrams(words)
words.
map{|word| [word.downcase.split('').sort.join, word]}.
inject(Hash.new{ [] }) {|h, element| h[element[0]] = h[element[0]] << element[1]; h }.
values
end