P23: Extract a given number of randomly selected elements from a list.