双指针解法
int* productExceptSelf(int* nums, int numsSize, int* returnSize){ int left = 1; int right = 1; int *temp = (int*)malloc(sizeof(int)*100000); for(int i=0; i<100000; i++) { temp[i] = 1; } for(int i=0; i<numsSize; i++) { temp[i] *= left; left *= nums[i]; temp[numsSize-1-i] *= right; right *= nums[numsSize-1-i]; } *returnSize = numsSize; return temp; }