init commit

This commit is contained in:
2024-03-19 01:05:51 +08:00
commit 199bbf2628
393 changed files with 34883 additions and 0 deletions

View File

@ -0,0 +1,28 @@
#include <stdio.h>
/**
* https://leetcode-cn.com/explore/interview/card/top-interview-questions-easy/1/array/24/
* 数组存在重复
*/
int containsDuplicate(int *nums, int numsSize)
{
for (int i = 0; i < numsSize - 1; i++)
{
for (int n = i + 1; n < numsSize; n++)
{
if (nums[i] == nums[n])
{
return 1;
}
}
}
return 0;
}
int main()
{
int nums[] = {1, 2, 3, 4, 5, 6, 7, 7};
containsDuplicate(nums, 8);
return 0;
}