前言
虽然力扣对我来说很难,但只要每天刷一点,就会慢慢增强能力,总有一天刷动力扣的难题,所以说,今天也是刷力扣的一天。 😆😆
/**
* Note: The returned array must be malloced, assume caller calls free().
*/
int* getConcatenation(int* nums, int numsSize, int* returnSize) {
int* p = (int*)malloc(numsSize * 2 * sizeof(int));
*returnSize = numsSize * 2;
for (int i = 0; i < numsSize; i++)
{
p[i] = nums[i];
p[i + numsSize] = nums[i];
}
return p;
}