Two-pass algorithm for ∪Set (set union) based on hashing