find duplicates in an array, first iteration done