input: Write a python function to group anagrams from a list of words using defaultdict.
  assert group_anagrams(["mister", "buster", "tired", "tries", "mines"]) == [['mister'], ['buster'], ['tired', 'tries'], ['mines']]
  assert group_anagrams(["listen", "silent", "enlist", "inlets", "google", "gogole"]) == [['listen', 'silent', 'enlist', 'inlets'], ['google', 'gogole']]
  assert group_anagrams(["cat", "act", "tac", "dog", "god"]) == [['cat', 'act', 'tac'], ['dog', 'god']]
output: from collections import defaultdict
  
  def group_anagrams(words):
      anagrams = defaultdict(list)
      for word in words:
          sorted_word = ''.join(sorted(word))
          anagrams[sorted_word].append(word)
      return list(anagrams.values())