- Find All Numbers Disappeared in an Array
题目分析:这也是跟前面有道题类似,用数组参数表达原数组元素。
int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize){
char * temp = (char *)malloc(numsSize*sizeof(char));
int * result = (int *)malloc(numsSize*sizeof(int));
int count = 0;
for(int i=0; i<numsSize; i++)
temp[nums[i]-1] = 1;
for(int i=1; i<=numsSize; i++)
if(temp[i-1] != 1)
result[count++] = i;
*returnSize = count;
return result;
}