Giving wrong output please have a look


#1

int Solution::findCount(const vector &A, int B) {
int start=0;
int end=A.size()-1;

int mid;

while(start<=end)
{
mid=(start+end)/2;
if(A[mid]==B)
{
return mid;

}
else if(A[mid]<B){
start=mid+1;
}
else{
end=mid-1;
}
}
return 0;
}