using System.Collections.Generic;
public static void Main()
Console.WriteLine("Working with SETS");
string[] admin = new string[] {"John","Amy","Joe"};
string[] finance = new string[] {"Jessica","Claire","Joe","Phil"};
HashSet<string>AdminSet = new HashSet<string>(admin);
HashSet<string>FinanceSet = new HashSet<string>(finance);
Console.WriteLine("Count of Data in Admin Set:"+AdminSet.Count);
Console.WriteLine("Count of Data in Admin Set:"+FinanceSet.Count);
HashSet<string>AdmFinSet = new HashSet<string>(AdminSet);
AdmFinSet.UnionWith(FinanceSet);
HashSet<string>AdmFinIntsctSet = new HashSet<string>(AdminSet);
AdmFinIntsctSet.IntersectWith(FinanceSet);
Console.WriteLine("The people listed are:");
foreach (string name in AdmFinSet)
Console.WriteLine("The Administrators are:");
foreach (string name in AdminSet)
Console.WriteLine("The people working in Finance are:");
foreach (string name in FinanceSet)
Console.WriteLine("The list of Administrators who also work in Finance is:");
foreach (string name in AdmFinIntsctSet)