We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53ce7c7 commit dc7c5e3Copy full SHA for dc7c5e3
two-sum/rlawjd10.c
@@ -0,0 +1,13 @@
1
+int compare(const void* a, const void* b) {
2
+ return (*(int*)a - *(int*)b); // 오름차순
3
+}
4
+
5
+bool containsDuplicate(int* nums, int numsSize) {
6
+ qsort(nums, numsSize, sizeof(int), compare);
7
8
+ for (int i = 1; i < numsSize; i++) {
9
+ if (nums[i] == nums[i-1])
10
+ return 1;
11
+ }
12
+ return 0;
13
0 commit comments