Forum Discussion
AlexanderM
12 years agoStaff
Hi,
I agree with Gennadiy - his solution is simple and clear. Also, if the number of elements to select is high, you may use a different approach:
Use an array of N possible values (may be generated programmatically), pick an index randomly in the [0..N-1] range, use the value having that index, then delete the value from the array, and pick another random index in the [0..N-2] range. This can be done in a loop to generate lengthy values with different digits.