add sparse set to calculate intersection of two unsorted array