# 解题思路:无 20190302 找工作期间
class Solution(object):
def intersection(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"""
set1 = set(nums1)
res = []
for i in set1:
if i in nums2:
res.append(i)
return res
2024-03-27 10:11:16
# 解题思路:无 20190302 找工作期间
class Solution(object):
def intersection(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"""
set1 = set(nums1)
res = []
for i in set1:
if i in nums2:
res.append(i)
return res