✅✅ Python 2 dicts + set intersection | 3 Lines | Beats 99% | O(n) ✅✅
Approach\n- Line 1: Make a dictionary for the frequency of nums1 & nums2 using the Counter function\n- Line 2: Create a set that is the intersection of the sets
# Approach\n- Line 1: Make a dictionary for the frequency of nums1 & nums2 using the Counter function\n- Line 2: Create a set that is the intersection of the sets of nums1 & nums2\n- Use the set from line 2 and the dictionaries from line 1 to calculate the sum of the intersecting elements of nums1 & nums2\n\n# Complexity\n- Time complexity:\n$$O(n)$$\n\n# Code\n```\nclass Solution:\n    def findIntersectionValues(self, nums1: List[int], nums2: List[int]) -> List[int]:\n        a, b = Counter(nums1), Counter(nums2)\n        e = set(nums1).intersection(set(nums2))\n        return [sum(a[x] for x in e), sum(b[x] for x in e)]\n\n```
['Python3']