Time for action – finding out when both doctors shall be present
Follow the given steps:
- Go back to the
Main()method and change its content as follows:
Console.WriteLine("Doctor A and Doctor B both shall be available on "); Console.WriteLine(); HashSet<DateTime> commonDates = AvailabilityOfDoctorA; commonDates.IntersectWith(AvailabilityOfDoctorB); foreach (DateTime d in commonDates) Console.WriteLine(d.ToLongDateString());
- Execute this new program.
What just happened?
You will see the following output:
Before we dig deep to see what caused the output, please note that every time you run this snippet, you shall see different results because the example ...