private int[] FindFrequency(int[] indexValues) { int[] tally = new int[2]; //size of 2 since its just binary foreach (int val in indexValues) { if (val == 0) tally[0]++; else if (val == 1) tally[1]++; } return tally; }