60. Intersection of Two Arrays

Return the intersection of two arrays with no duplicates in the result.
Example 1
Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2]
Explanation: Only the value 2 remains in the unique intersection.
Example 2
Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
Output: [4,9]
Explanation: Both arrays contain 4 and 9, and each appears once in the unique result.
arrayseasyhash table
JavaScript
Loading...
Line 1, Char 1