349. Intersection of Two Arrays python

xiaoxiao2021-02-28  17

给定两个数组,写一个函数来计算它们的交集。

class Solution(object): def intersection(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: List[int] """ return list(set(nums1) & set(nums2))
转载请注明原文地址: https://www.6miu.com/read-1900007.html

最新回复(0)