https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/
class Solution {
public int removeDuplicates(int[] nums) {
if(nums.length==0) {
return 0;
}
int num=nums[0],location=1;
for (int i=1;i< nums.length;i++) {
if(nums[i]!=num) {
num=nums[i];
nums[location]=num;
location++;
}
}
return location;
}
}