标签:
#-*- coding: UTF-8 -*-
#求两个集合的交集
class Solution(object):
def intersection(self, nums1, nums2):
resultList=list(set(nums1).intersection(set(nums2)))
return resultList
sol=Solution()
print sol.intersection(nums1=[1, 2, 2, 1], nums2=[2,2])
【leetcode?python】Intersection of Two Arrays
标签:
原文地址:http://www.cnblogs.com/kwangeline/p/5953697.html