Indeed interview question

How to find an intersection of two integer arrays?

Interview Answer

Anonymous

5 Feb 2022

Add first array in the hashmap using number as key and value as true (does not matter what the value is). traverse throw second array using for loop and check if number exists in the hashmap and add it in the return array.