public int removeDuplicates(int[] nums) {

int len = nums.length;

int index = 1;

if(len == 0)return 0;

int cur = nums[0];

for(int i = 1; i < len; i++){

if(nums[i] == cur){

continue;

}else{

nums[index] = nums[i];

cur = nums[i];

index++;

}

}

return index;

}