I found similar question about interleaving two arraylists into one, but its in PHP. I was asked this question in interview as well but could\'nt solve it, came back to SO t
For simplicity, assume that the arrays are the same length, and are int arrays.
int
int[] merge(int[] a, int[] b) { assert (a.length == b.length); int[] result = new int[a.length + b.length]; for (int i=0; i