题目
、
代码部分(10ms 97.32%)
class Solution {
public int removeDuplicates(int[] nums) {
int n = 0;
boolean flag = false;
for(int i = 0; i < nums.length; i++){
if(nums[i] != nums[n]) {
n++;
nums[n] = nums[i];
}
}
return n + 1;
}
}