Wrong ans on submition

int Solution::removeDuplicates(vector &A) {
int n=A.size(),count=0;
for(int i=0;i<n;i++){
if(A[i]==A[i+1])continue;
else{
A[count++]=A[i];
}
}

return count;

}
Test Case- A : [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 ]

Click here to start solving coding interview questions