I have anint[] a and int[] b of same size and I was trying to put them into new array int[] c and in c, the elements at odd indices would be a's elements and even elements would be b's. Heres what I have done so far.
int[] c = new int[a.length + b.length];
for (int i = 0; i < a.length; i++) {
c[i] = a[i];
}
for (int i = 0; i < b.length; i++) {
c[i + a.length] = b[i];
}
Here is an example of what I was asking: Given a:[0,1,2,3], b:[4,5,6,7], return [0,4,1,5,2,6,3,7].
How do I arrange them in even and odd order? I searched up everywhere but could not find a thread.