class Solution {

public:

vector<int> searchRange(vector<int>& nums, int target) {

pair<vector<int>::iterator,vector<int>::iterator> pr = equal_range(nums.begin(),nums.end(),target);

vector<int>ans;

if(pr.first == pr.second){

ans.push_back(-1);

ans.push_back(-1);

return ans;

}

ans.push_back(distance(nums.begin(),pr.first));

ans.push_back(distance(nums.begin(),pr.second-1));

return ans;

}

};