using MoreLinq;
int[] hoge ={1,5,8,3,6,1,2,5,4,1,1,4,8,1};
hoge.CountBy(x=>x).ForEach(x=>Console.WriteLine(x));
[1, 5]
[5, 2]
[8, 2]
[3, 1]
[6, 1]
[2, 1]
[4, 2]