标签:return imp bsp counter array elements list leetcode etc
python可重集合的操作
class Solution(object): def intersect(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: List[int] """ from collections import Counter c1 = Counter(nums1) c2 = Counter(nums2) return list((c1&c2).elements())
Leetcode 350. Intersection of Two Arrays II
标签:return imp bsp counter array elements list leetcode etc
原文地址:https://www.cnblogs.com/zywscq/p/10513623.html