Return the index such that array[index-1] < key <= array[index].