public static int HistogramMax(this int[] values) { int max = 0; for (int i = 0; i < values.Length; i++) if (i > max) max = i; return max; }