leetcode 349. Intersection of Two Arrays 两个数组的交集 python 最简代码(集合去重复, 求交集)

class Solution:
    def intersection(self, nums1, nums2):
        """
        :type nums1: List[int]
        :type nums2: List[int]
        :rtype: List[int]
        """
        return list(set(nums1) & set(nums2)) 

猜你喜欢

转载自blog.csdn.net/huhehaotechangsha/article/details/80812680