find an intersection between integer arrays
Utilisateur anonyme
A faster way is to determine which is the smaller array, sort it, then use binary search to determine which of the larger array is in the smaller array. Total time complexity is O((n+m)log m) where m is the size of the smaller list and n is the size of the larger array. this is better than the previous answer which is n*m.