A Dictionary<T,bool> can be used instead of HashSet<T> . If you add elements with the value True or False, this is a coin toss; the value does not matter.
This is more cumbersome than a HashSet<T> , and not quite easy, but it is certainly better than a List<T> .
Tergiver
source share