- Leetcode-26Remove Duplicates fro
- LeetCode 26. Remove Duplicates f
- ZXAlgorithm - Leetcode Top Inter
- Remove Duplicates from Sorted Ar
- 26 Remove Duplicates From Sorted
- 83 Remove Duplicates From Sorted
- Remove Duplicates from Sorted Ar
- Remove Duplicates from Sorted Ar
- Remove Duplicates from Sorted Ar
- Remove Duplicates from Sorted Ar
有序数组中移除重复数字
int removeDuplicates(int* nums, int numsSize) {
if(NULL == nums || numsSize <= 0)
{
return 0;
}
int temp = nums[0];
int index = 0;
for(int i = 1; i < numsSize; i++)
{
if(nums[i] != temp)
{
index++;
nums[index] = nums[i];
temp = nums[i];
}
}
index ++;
return index;
}
网友评论