Easy
我two pointers跟废了一样,这种easy题都不会,真的够了。
class Solution {
public int removeDuplicates(int[] nums) {
int len = nums.length;
int index = 1;
for (int i = 1; i < len; i++){
if (nums[i] != nums[i - 1]){
nums[index++] = nums[i];
}
}
return index;
}
}