title: anagram algorithm
body: <p>Which is the best way of generating anagrams for a text(maximum 80 characters length).
  Example:
  Input: dog
  output dog dgo odg ogd gdo god</p>
  
  <p>I'm only thinking of a backtracking solution, but that will take a while if the text is longer.</p>
  
  <p>Another thought is bulding i trie for all words in dictionary, but the problem doesn't ask for real words.</p>
  
  <p>Can somebody point out a minimum time complexity solution?</p>
  
  <p>Thank you!</p>