We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40c99b6 commit b071a7eCopy full SHA for b071a7e
Solutions/0350-intersection-of-two-arrays-ii/solution.py
@@ -0,0 +1,11 @@
1
+class Solution:
2
+ def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]:
3
+ count = Counter(nums1)
4
+ result = []
5
+
6
+ for val in nums2:
7
+ if count[val]:
8
+ result.append(val)
9
+ count[val] -= 1
10
11
+ return result
0 commit comments