【leetcode】重新排列数组

int* shuffle(int* nums, int numsSize, int n, int* returnSize){
    int* arr = (int*)calloc(numsSize, sizeof(int));
    int pst = 0;
    for (int i = 0; i < numsSize/2; i++)
    {
        arr[pst++] = nums[i];
        arr[pst++] = nums[i+n];
    }
    *returnSize = numsSize;
    return arr;
}
原文地址:https://www.cnblogs.com/ganxiang/p/13619419.html