---
# System prepended metadata

title: '[1470. Shuffle the Array](https://leetcode.com/problems/shuffle-the-array/submissions/)'

---

# [1470. Shuffle the Array](https://leetcode.com/problems/shuffle-the-array/submissions/)
![](https://i.imgur.com/NEk85oi.png)
![](https://i.imgur.com/PBGxHQy.png)

int* shuffle(int* nums, int numsSize, int n, int* returnSize){
    int* res=(int*)malloc(sizeof(int)*numsSize);
    *returnSize=numsSize;
    for(int i=0;i<n;i++){
        res[2*i]=nums[i];
        res[2*i+1]=nums[n+i];
    }
    return res;
}