```
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int j=0;
if(nums.size()==0)
return 0;
for(int i=1;i<nums.size();i++)
if(nums[j]!=nums[i])
{
j++;
nums[j]=nums[i];
}
return j+1;
}
};
```

I am a Chinese ,and I want to make friends with you, then we can talk about problems.

And I want to improve my English.

My email : skyqsk@126.com