How to set the values in serial on getting random order from dynamic array

In reply to javatea:
Hi,

Shuffle is not helping I tried it. But it will again give some random sequence.
AS output of below :
value[0] = 3;
value[1] = 2;
value[2] = 2;
value[3] = 1;
value[4] = 1;
value[5] = 4;
value[6] = 3;
value[7] = 2;
value[8] = 4;
value[9] = 4;
value[10] = 1;
value[11] = 3;
will be
temp[0] = 1;
temp[1] = 4;
temp[2] = 4;
temp[3] = 3; and so on… while requirement is all unique come in starting as in this case 4 values are unique so first four index will be with unique, same for next four index.