class Solution {
public int[] shuffle(int[] nums, int n) {
int nextAccount=0,frontAccount=0;
int[] front = new int[nums.length/2];
int[] next = new int[nums.length/2];
int[] array = new int[nums.length];
for (int i = 0; i < n; i++) {
front[i] = nums[i];
}
for (int j = n,g = 0; j < nums.length && g < n; j++,g++) {
next[g] = nums[j];
}
for (int h = 0; h < nums.length; h++) {
if(h%2==0){
array[h] = front[frontAccount];
frontAccount++;
}
else{
array[h] = next[nextAccount];
nextAccount++;
}
}
return array;
}
}