Return an array of duplicated values in a given array