Given two integer arrays, return their intersection.
Every element in the result must be unique; the order does not matter.
nums1 = [1,2,2,1], nums2 = [2,2]
[2]
nums1 = [4,9,5], nums2 = [9,4,9,8,4]
[4,9]
1 <= nums1.length, nums2.length <= 1000 0 <= nums1[i], nums2[i] <= 1000
Topics
Implement intersection in the editor and return the answer — printing it is never graded.
intersection
Problem 37 of 1146 in the arena