HashSet — unique elements, O(1) lookup. List — ordered, O(n) lookup.
HashSet:
List:
1// HashSet2var set = new HashSet<int> { 1, 2, 3 };3set.Add(2); // Ignored (already exists)4bool has = set.Contains(1); // O(1)56// List7var list = new List<int> { 1, 2, 3 };8list.Add(2); // Added (duplicates OK)9bool has = list.Contains(1); // O(n)
Key: HashSet for uniqueness, List for ordering.