I have an array of numbers:
int[] array = new int[]{ 18, 5, 10, 12, 15, 18 };
how do I count all numbers above a certain level (without repetitions)? will LINQ be any help?
For example - there are 3 numbers above 10 (18,and 15, 12).
there's only 1 number above 15 (18,18 are practically the same number).
edit: (sorry forgot about this one)
is it possible to count repetitions above a certain level?
i.e. in my example with "15" there will be 2 repetitions
edit 2
my way of "grouping"
int count1 = array.Where(x => x > 15).Distinct().Count();
int count2 = array.Where( x => x > 15).Count();
int count3 = count2 - count1;