You are given two integer arrays, arr1 and arr2. Your task is to return a new array containing the intersection of both arrays.
Constraints
1≤ arr1.length, arr2.length ≤1000
0≤arr1[i], arr2[i] ≤1000
The essence of this solution lies in using a hash map to efficiently find the unique intersection of two arrays. A naive approach would be to compare every element of the first array with every element of the second, which results in a time complexity of O( ...