public static void Main(string[] args)
byte[] blocks = { 3, 1, 4, 1, 1, 1, 4, 3, 1, 1, 6, 7 };
Console.WriteLine (CountUniqueBytes(blocks));
static int CountUniqueBytes(byte[] blocks)
.Aggregate(new ulong[4], (mask, b) =>
mask[b / 64] |= 1UL << (b % 64);
return bitmask.Sum(BitOperations.PopCount);