Update intersection_two_arrays.py

This commit is contained in:
marina 2023-08-07 17:31:08 -07:00 committed by GitHub
parent 2fe4c94c7f
commit 2d0842019d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ def intersect(nums1: list[int], nums2: list[int]) -> list[int]:
counter = Counter(nums1) & Counter(nums2)
for n in set_nums:
result.extend([n]*counter[n])
result.extend([n] * counter[n])
return result