728x90
https://leetcode.com/problems/intersection-of-two-arrays
class Solution:
def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
return list(set(nums1).intersection(nums2))
728x90
'IT > 코딩테스트' 카테고리의 다른 글
[Leetcode] 791. Custom Sort String (0) | 2024.03.11 |
---|---|
[Leetcode] 3074. Apple Redistribution into Boxes (0) | 2024.03.10 |
[Leetcode] 2540. Minimum Common Value (0) | 2024.03.09 |
[Leetcode] 3005. Count Elements With Maximum Frequency (1) | 2024.03.08 |
[Leetcode] 2864. Maximum Odd Binary Number (0) | 2024.03.08 |