As part of a test bench I\'m building, I\'m looking for a simple class to calculate a histogram of integer values (number of iterations taken for an algorithm to solve a pro
My implementation of a simple extension method to create a histogram:
public static IReadOnlyDictionary ToHistogram(this IEnumerable enumerable) => enumerable.GroupBy(item => item).ToDictionary(grouping => grouping.Key, grouping => grouping.Count());