fork download
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var l = new[] { 1, 3, 5, 1, 1, 7, 2, 7 };
  9. var rr = l.GroupBy(v => v).Where(g => g.Count() > 1).Select(g => g.Key);
  10. foreach (var r in rr)
  11. Console.WriteLine(r);
  12. }
  13. }
Success #stdin #stdout 0.04s 34168KB
stdin
Standard input is empty
stdout
1
7