Compact Python solution


  • 0
    S
    class Solution:
        def intersect(self, nums1, nums2):
            return list((collections.Counter(nums1) & collections.Counter(nums2)).elements())
    

Log in to reply
 

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