```
int removeDuplicates(int A[], int n) {
if(n<=2)
return n;
int count = 0;
int i = 0;
while(i<n)
{
int j = i+1;
while(A[j]==A[i])
j++;
A[count] = A[i];
count++;
i = (j==i+1)?i+1 : j-1;
}
return count;
}
```

In this case ,the system got the wrong answer

```
Input: [0,0,0,0,0]
Output: [0]
Expected:[0,0]
```

But on my computer, I got [0,0] exactly.