LeetCode 26 Remove Duplicates from Sorted Array
LeetCode 26 Remove Duplicates from Sorted Array
与27题类似 http://www.cnblogs.com/walker-lee/p/4994950.html
int removeDuplicates(int* nums, int numsSize) { if(numsSize<=0) return 0; if(numsSize==1) return 1; int n=0; for(int i=1;i<numsSize;i++) { if(nums[i]!=nums[n]) nums[++n]=nums[i]; } return n+1; }