Create count duplicates in sorted array