public class Solution {
public int RemoveDuplicates(int[] nums) {
var left = 0;
for(var right = 1; right< nums.Length; right++) {
//如果左指针和右指针指向的值一样,说明有重复的,
//这个时候,左指针不动,右指针继续往右移。如果他俩
//指向的值不一样就把右指针指向的值往前挪
if(nums[left] != nums[right]){
nums[++left] = nums[right];
}
}
return ++left;
}
}
标签:right,nums,++,指针,算法,数组,排序,left
From: https://www.cnblogs.com/ProCheng/p/16864979.html