标签:pre nts comm cti har def leetcode sel self
python可重集合操作
class Solution(object): def commonChars(self, A): """ :type A: List[str] :rtype: List[str] """ if not A: return [] from collections import Counter ans=Counter(A[0]) for str in A: ans&=Counter(str) ans=list(ans.elements()) return ans
Leetcode 1002. Find Common Characters
标签:pre nts comm cti har def leetcode sel self
原文地址:https://www.cnblogs.com/zywscq/p/10513632.html