class Solution {
public:
/**
* @param A: a list of integers
* @return : return an integer
*/
int removeDuplicates(vector<int> &nums) {
// write your code here
int length=nums;
for(int i=0;i<nums;i++)
{
if(a[i]==a[i+1])
length--;
}
return length;
}
};
转载于:https://www.cnblogs.com/fu520631/p/6522851.html