Tavern Challenge


I don’t really understand how use a sequence to generate all the unique names.

From what I understand, a sequence doesn’t produce any values until it is asked to. Am I correct in thinking that in the code provided for generating a random set of names using the sequence, nothing will be generated until toSet() is called? If that is the case, how are you supposed to check the current name being generated to the previously generated names? When I look back at the prime number example, I don’t see how to apply that to the challenge. I understand how the filter function works in that context as it doesn’t have to check against any of the previously generated values.