Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 6 lines (6 sloc) 0.202 kb
1 2 3 4 5 6
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
Something went wrong with that request. Please try again.