fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var numbs4 = new List<dynamic>() { 12, 9, 75,75, 23, 12, 33, 34, 54, 21, 22 };
  10.  
  11.  
  12. var result = numbs4
  13. .GroupBy(x =>x)
  14. .OrderByDescending(g => g.Key)
  15. .First() // That's the first group
  16. .ToList();
  17.  
  18. foreach (var i in result) {
  19. Console.WriteLine(i);
  20. }
  21.  
  22. }
  23. }
Success #stdin #stdout 0.26s 35720KB
stdin
Standard input is empty
stdout
75
75