leetcode349 python3 112ms 求两个数组的交集

class Solution:
    def intersection(self, nums1, nums2):
        """
        :type nums1: List[int]
        :type nums2: List[int]
        :rtype: List[int]
        """
        s = []
        for i in nums1:
            if i not in s and  i in nums2 :
                s.append(i)
        return s
        
posted @ 2018-08-10 18:12  一条图图犬  阅读(204)  评论(0编辑  收藏  举报