public static void Main()
int[] array1 = { 2, 5, 8, 10, 2, 23, 2, 4, 5, 8, 8 };
int[] arraySemRepeticao = array1.Distinct().ToArray();
var arrayAgrupadosRepeticao = array1.GroupBy(x => x)
foreach(var a in arraySemRepeticao.OrderBy(x => x))
Console.WriteLine("---------------------------------------------");
foreach(var a in arrayAgrupadosRepeticao)
Console.WriteLine(a.Item + " " + a.Quant);