【leetcode】重新排列数组

2021-03-29 00:27

阅读:339

标签:bsp   shu   col   leetcode   scroll   import   color   imp   for   

 

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 2; i++)
    {
        arr[pst++] = nums[i];
        arr[pst++] = nums[i+n];
    }
    *returnSize = numsSize;
    return arr;
}

 

【leetcode】重新排列数组

标签:bsp   shu   col   leetcode   scroll   import   color   imp   for   

原文地址:https://www.cnblogs.com/ganxiang/p/13619419.html


评论


亲,登录后才可以留言!