Am I just to blind to see the solution?
sampleSum = 0;
for(int x : sampleWeights)
sampleSum += x;
population = new int[sampleSum];
int z = 0;
for(int i = 0; i < nsamples; i++)
for(int j = 0; j < sampleWeights[i]; j++)
{
population[z] = i;
z++;
}
Any help is appreciated! Thanks!