class Solution {

public:

int removeDuplicates(vector<int>& nums) {

```
if(nums.size() == 0 || nums.size() == 1)
return nums.size();
int n = nums[0];
int count = 1;
for(int i=1;i<nums.size();i++)
{
if(nums[i] != n)
{
nums[count]=nums[i];
n=nums[i];
count++;
}
}
return count;
}
```

};