Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import itertools
  2. def funWithAnagrams(s):
  3.  
  4. listOfSortedWords = []
  5. counter = 0
  6.  
  7. #Sorting
  8. for word in s:
  9. listOfSortedWords.append(sorted(word))
  10.  
  11. return list(listOfSortedWords for listOfSortedWords,_ in itertools.groupby(listOfSortedWords))
  12. print(funWithAnagrams(["doce","code","ecod","framer","frame"]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement