diff --git "a/\344\270\244\346\225\260\344\271\213\345\222\214" "b/\344\270\244\346\225\260\344\271\213\345\222\214" new file mode 100644 index 0000000000000000000000000000000000000000..faa54ddfcdd53f500a4dc961491fec6563269492 --- /dev/null +++ "b/\344\270\244\346\225\260\344\271\213\345\222\214" @@ -0,0 +1,16 @@ +int* twoSum(int* nums, int numsSize, int target, int* returnSize) { + for (int i = 0; i < numsSize; ++i) { + for (int j = i + 1; j < numsSize; ++j) { + if (nums[i] + nums[j] == target) { + int* ret = malloc(sizeof(int) * 2); + ret[0] = i, ret[1] = j; + *returnSize = 2; + return ret; + } + } + } + *returnSize = 0; + return NULL; +} + + \ No newline at end of file