๐
ํ์ด์ฌ ์๊ณ ๋ฆฌ์ฆ ์ธํฐ๋ทฐ
์ฑ ์ ์ฐธ๊ณ ํ์ต๋๋ค.
๋ ๋ฐฐ์ด์ ๊ต์งํฉ์ ๊ตฌํ์ธ์.
class Solution:
def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
result = set()
nums2.sort()
for n1 in nums1:
i2 = bisect.bisect_left(nums2, n1)
if len(nums2) > i2 and i2 >= 0 and nums2[i2] == n1:
result.add(n1)
return result