int findRepeatNumber(int* nums, int numsSize){ int max = nums[0]; for (int j = 1; j<numsSize; j++) { if (nums[j] > max) max = nums[j]; } int *hash = (int *)calloc(max+1, sizeof(int)); for(int i = 0; i < numsSize; i++){ if(hash[nums[i]] == 1){ return nums[i]; } else { hash[nums[i]]++; } } return -1; }