Array: binary search for start and end of an element