美文网首页Leetcode
349. Intersection of Two Arrays

349. Intersection of Two Arrays

作者: oo上海 | 来源:发表于2016-08-02 08:52 被阅读7次

349. Intersection of Two Arrays

题目:
https://leetcode.com/problems/intersection-of-two-arrays/

难度:

Easy

Python一句话作弊

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

相关文章

网友评论

    本文标题:349. Intersection of Two Arrays

    本文链接:https://www.haomeiwen.com/subject/elsfsttx.html