#NEWLINE# def anagrams( self , strs ) : #NEWLINE# #INDENT# ret = [ ] #NEWLINE# cnt = defaultdict ( int ) #NEWLINE# for s in strs : #NEWLINE# #INDENT# enc = self . encode ( s ) #NEWLINE# cnt [ enc ] += 1 #NEWLINE# #UNINDENT# for s in strs : #NEWLINE# #INDENT# enc = self . encode ( s ) #NEWLINE# if ( cnt [ enc ] > 1 ) : #NEWLINE# #INDENT# ret . append ( s ) #NEWLINE# #UNINDENT# #UNINDENT# return ret