compute array intersection using dictionary