def anagrams(self, strs): # write your code here L = [i if len(i) <= 1 else sorted(i) for i in strs] return [strs[i] for i in range(len(L)) if L.count(L[i]) > 1]
def anagrams(self, strs): # write your code here L = [i if len(i) <= 1 else sorted(i) for i in strs] return [strs[i] for i in range(len(L)) if L.count(L[i]) > 1]
原文:https://www.cnblogs.com/tingway/p/8543991.html