28: Arrays intersection

Find the intersection of two arrays

Each element in the result must be unique

 

Example 1

Input: array1 = [15, 9, 23, 9] array2 = [16, 23, 9]

Output: [9, 23]

Example 2

Input: array1 = [2, 4, 5] array2 = [16, 23, 9]

Output: []
Difficulty:Easy
Topic:HashSet
Problem #:28