Skip to content

Commit 957ad63

Browse files
Added solution
1 parent 8ae140b commit 957ad63

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

intersection_of_2_arrays.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution:
2+
def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
3+
4+
'''
5+
if len(nums1) == 0 or len(nums2) == 0:
6+
return []
7+
st = set()
8+
for ele in nums1:
9+
if ele in nums2:
10+
st.add(ele)
11+
return list(st)
12+
'''
13+
return list(set(nums1) & set(nums2))

0 commit comments

Comments
 (0)