print all duplicate elements in the array