# include <stdio.h>
int findReaptNumber(int* nums, int numsSize)
{
int arr[100000] = { 0 };
for (int i = 0; i < numsSize; i++)
{
arr[nums[i]]++;
}
for (int i = 0; i < numsSize; i++)
{
if (arr[i] >= 2)
{
return i;
}
}
return -1;
}
int main()
{
int num[5] = { 2,3,4,2,3 };
int n = findReaptNumber(num,sizeof(num)/sizeof(num[0]));
printf("%d\n", n);
return 0;
}
09-09
356
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountBlack.png)