leetcode349 python3 112ms 求两个数组的交集
Posted 一条图图犬
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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
以上是关于leetcode349 python3 112ms 求两个数组的交集的主要内容,如果未能解决你的问题,请参考以下文章