Hello users check this out

help me to correct this code…
int first(const vector &A,int low,int high, int B){
if (high>=low){
int mid=low+(high-low)/2;
if((mid==0 || B>A[mid-1])&& A[mid]==B)
return mid;
else if(B>A[mid])
return first(A, mid+1, high, B);
else
return first(A, low, mid-1,B);
}
return -1;
}
int last(const vector &A,int low,int high, int B){
if(high>=low){
int mid=low+(high-low)/2;
if((mid=A.size()-1|| B<A[mid+1] )&&A[mid]==B)
return mid;
else if(B<A[mid])
return last(A, low, mid-1, B);
else return last(A, mid+1, high, B);
}
return -1;
}
vector Solution::searchRange(const vector &A, int B) {
int n=A.size();
vectorv(2);
v[0]=first(A,0,n-1,B);
v[1]=last(A,0,n-1,B);
return v;

Click here to start solving coding interview questions