You have an array of 100 numbers and draw from a pool of 10 different ones. How would you expect there to be no duplicates?
Don't overcomplicate the thing, just write what needs to be written. I.e.:
- Create the array
- Loop over the size of it
- Put a random number between from [0, 9] in the array.