28: Arrays intersection

Find the intersection of two arrays

 

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: []