#K85742. Interleave Two Arrays
Interleave Two Arrays
Interleave Two Arrays
You are given two arrays of equal length. The task is to interleave the arrays, taking one element from the first array and then one from the second array, and so on. In other words, if the two arrays are \(A = [a_1, a_2, \dots, a_n]\) and \(B = [b_1, b_2, \dots, b_n]\), the resulting array should be \( [a_1, b_1, a_2, b_2, \dots, a_n, b_n] \).
Read the input from stdin and print the result to stdout.
inputFormat
The input consists of three lines. The first line contains an integer (n), which represents the number of elements in each array. The second line contains (n) space-separated integers denoting the first array. The third line contains (n) space-separated integers denoting the second array.
outputFormat
Output a single line containing (2n) space-separated integers representing the interleaved array.## sample
3
1 2 3
4 5 6
1 4 2 5 3 6