Find duplicates using hash table