首页 > 编程语言 > 详细

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

时间:2018-08-10 19:08:38      阅读:147      评论:0      收藏:0      [点我收藏+]
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
        

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

原文:https://www.cnblogs.com/theodoric008/p/9456700.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!