sample

open fun sample(): T

Returns an element randomly selected from the list

Return

a randomly selected element from the list


open fun sample(size: Int): List<T>

Returns sample of size from the list

Return

randomly selected elements as a list