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