using System.Collections.Generic;
public static void Main()
Console.WriteLine("Hello World");
var input = new List<FirstClass>
new FirstClass { EmployeeNo = "a", SecondClass = new List<SecondClass> { new SecondClass { Count = 5}, new SecondClass { Count = 10}}},
new FirstClass { EmployeeNo = "b", SecondClass = new List<SecondClass> { new SecondClass { Count = 6}, new SecondClass { Count = 11}}},
new FirstClass { EmployeeNo = "c", SecondClass = new List<SecondClass> { new SecondClass { Count = 7}, new SecondClass { Count = 12}}},
int highestCount = input.Select(x => x.SecondClass.Select(y => y.Count).Max()).Max();
Console.WriteLine(highestCount);
var itemWithHighestCount = input.OrderByDescending(x => x.SecondClass.Select(y => y.Count).Max()).FirstOrDefault();
Console.WriteLine(itemWithHighestCount.EmployeeNo + " " + string.Join(", ", itemWithHighestCount.SecondClass.Select(x => "Count="+x.Count)));
public string EmployeeNo { get; set; }
public List<SecondClass> SecondClass { get; set; }
public int Count { get; set; }