binary search on repeated elements in array