Since the problem requires us to implement binary search...... just post for reference.

```
vector<int> searchRange(vector<int>& nums, int target) {
vector<int> res(2, -1);
if(find(nums.begin(), nums.end(), target)==nums.end())
return res;
auto low=lower_bound(nums.begin(), nums.end(), target);
auto high=upper_bound(nums.begin(), nums.end(), target);
res[0]=(int)(low-nums.begin());
res[1]=(int)(high-nums.begin())-1;
return res;
}
```