### Problem
Search the strictly increasing array nums for target. Return its zero-based index if present, otherwise -1. The search must take O(log n) time.
```cpp
class Solution {
public:
int search(vector<int>& nums, int target);
};
```
### Examples
**Example 1:**
```text
nums = [-4,1,6,10], target = 6
Output: 2
Explanation: nums[2] equals the target.
```
**Example 2:**
```text
nums = [-4,1,6,10], target = 5
Output: -1
Explanation: No array position holds 5.
```
### Constraints
- There are 1 through 10000 entries, in strictly increasing order.
- Both entries and target are strictly between -10000 and 10000.
### Contract considerations
Preserve the required logarithmic time and return an index.
```hint Read the boundary condition
What half can be eliminated by a single midpoint comparison?
```
### Boundary reminders
Preserve the required logarithmic time and return an index.
Overview: Find an Index by Halving a Sorted Range. Search the strictly increasing array nums for target. Return its zero-based index if present, otherwise -1.