using System.Collections.Generic;
var list = new List<int> {1,3,100,5,7,7,7,-1,7,17,8,9,0,9,12,18,18};
Console.WriteLine((BinarySearch(list, number, list.Count, false) - BinarySearch(list, number, list.Count, true) + 1) + " time(s)");
int BinarySearch(List<int> list, int item, int len, bool isLower)
int start = 0, mid, index = -1;
else if (item < list[mid])
else if (item > list[mid])