Wrong Answer, Test Case Missing

Which test case I am missing?
vector Solution::nextPermutation(vector &a) {
int ind, n=a.size();
if(n==1)
return a;
int i=n-2;
while(i>=0 && a[i]>=a[i+1])
i–;
if(i<0){
reverse(a.begin(), a.end());
return a;
}
int l=i+1, r=n-1, mid=(l+r)/2;
ind=-1;
while(l<=r){
mid=(l+r)/2;
if(a[mid]<=a[i]){
r=mid-1;
}
else{
l=mid+1;
if(ind==-1 || a[ind]>=a[mid])
ind=mid;
}
}

swap(a[i], a[ind]);
reverse(a.begin()+i+1, a.end());

return a;

}

Click here to start solving coding interview questions