Create Duplicates in an array.cpp