Anagram

An anagram is a type of word play, the result of rearranging the letters of a word or phrase to produce a new word or phrase

For example, all the anagrams of "fur" are "ufr", "urf", "fru", "ruf", "rfu" and "fur".

For example, all the anagrams of "abcc" are "abcc", "acbc", "accb", "bacc", "bcac", "bcca", "cabc", "cacb", "cbac", "cbca", "ccab", "ccba"

Write a function to return an alphabetically sorted array of all unique (no duplicates) anagrams of a given string.

def anagrams(str)
  # input your magic here
end

results matching ""

    No results matching ""