Implement binary search for finding counts for hover.