var grades = students.GroupBy(s => s.Subject);
var hasEnglish = grades.Any(g => g.Key == "English");The code above checks if the grades collection contains a group with the key "English", indicating that at least one student is enrolled in an English class. The Groups.Contains method is a part of the System.Linq package library in C#.