sampleWithReplacement
Returns n elements sampled uniformly at random with replacement.
Each element is chosen independently, so the same position can be picked multiple times and n may exceed the collection size. An n of zero yields the empty list even for an empty collection.
Parameters
n
the number of elements to sample, must be non-negative.
random
the source of randomness, Random.Default by default.