1. 程式人生 > >171.亂序字符串

171.亂序字符串

pos blog elf 亂序 true write anagram python highlight

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]  

  

171.亂序字符串