Python 1 line solution


  • 0
    A
    def intersection(self, nums1, nums2):
        # need to import collections library
        return [digit for digit in collections.Counter(nums1) if digit in nums2]

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.