6 kyu

Get All Possible Anagrams from a Hash

405 of 698Mackay

Description:

Given a hash of letters and the number of times they occur, recreate all of the possible anagram combinations that could be created using all of the letters, sorted alphabetically.

The inputs will never include numbers, spaces or any special characters, only lowercase letters a-z.

E.g. get_words({2=>["a"], 1=>["b", "c"]}) => ["aabc", "aacb", "abac", "abca", "acab", "acba", "baac", "baca", "bcaa", "caab", "caba", "cbaa"]

Puzzles

Stats:

CreatedOct 15, 2014
PublishedOct 15, 2014
Warriors Trained1718
Total Skips460
Total Code Submissions2855
Total Times Completed698
Ruby Completions175
Python Completions405
JavaScript Completions146
Total Stars39
% of votes with a positive feedback rating95% of 160
Total "Very Satisfied" Votes144
Total "Somewhat Satisfied" Votes15
Total "Not Satisfied" Votes1
Ad
Contributors
  • Mackay Avatar
  • jhoffner Avatar
  • GiacomoSorbi Avatar
  • smile67 Avatar
  • FArekkusu Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad