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