[Release notes](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-9/overview#linq) [Docs](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.countby?view=net-9.0) ```c# KeyValuePair<string, int> mostFrequentWord = sourceText .Split(new char[] { ' ', '.', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(word => word.ToLowerInvariant()) .CountBy(word => word) .MaxBy(pair => pair.Value); ```