Extracts the indexes of the duplicate elements including the original element