1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
static void NakamaHazure(params int[] a)
{
    var x = from y in a
            group y by y into z
            orderby z.Count() ascending
            select new { count = z.Count(), value = z.Key };

    if (a.Length == x.ElementAt(0).count)
    {
        Console.WriteLine(x.ElementAt(0).value );
    }
    else if (x.Count() == 2 && x.ElementAt(0).count == 1 )
    {
        Console.WriteLine(x.ElementAt(0).value + "," + x.ElementAt(1).value);
    }
}