Updated: 2024-03-12
1 min read
On This Page
class Solution:
def findIntersectionValues(self, nums1: List[int], nums2: List[int]) -> List[int]:
s1, s2 = set(nums1), set(nums2)
return [sum(x in s2 for x in nums1), sum(x in s1 for x in nums2)]