leetcode链接在这里
双指针法
class Solution {
public int removeDuplicates(int[] nums) {
if(nums.length < 1){
return nums.length;
}
int i = 0;
int j = 1;
while(j < nums.length){
if(nums[i] == nums[j]){
j++;
}else{
nums[++i] = nums[j++];
}
}
return i + 1;
}
}



