input: Write a python function to find anagrams in a list of strings.
  assert find_anagrams(["listen", "silent", "enlist", "hello", "world"]) == [["listen", "silent", "enlist"], ["silent", "listen", "enlist"], ["enlist", "listen", "silent"], ["hello"], ["world"]]
  assert find_anagrams(["abc", "bac", "cab", "xyz", "zyx", "yxz"]) == [["abc", "bac", "cab"], ["bac", "abc", "cab"], ["cab", "abc", "bac"], ["xyz", "zyx", "yxz"], ["zyx", "xyz", "yxz"], ["yxz", "xyz", "zyx"]]
  assert find_anagrams(["a", "b", "c", "a"]) == [["a", "a"], ["b"], ["c"], ["a", "a"]]
output: def find_anagrams(words):
      from collections import defaultdict
      
      anagrams = defaultdict(list)
      
      for word in words:
          sorted_word = ''.join(sorted(word))
          anagrams[sorted_word].append(word)
      
      result = []
      for group in anagrams.values():
          for word in group:
              others = [w for w in group if w != word]
              if not others:
                  result.append([word])
              else:
                  result.append([word] + others)
      
      return result