I want to know the shortest route to do this, thus asking the question, though it can be done in many ways.
Suppose there are two arrays
A1 = [x1 y1
x2 y2
x3 y3
0 0
0 0
0 0
0 0
]
and
A2 = [a1 b1
a2 b2
a3 b3
a4 b4
0 0
0 0
0 0
]
Now, how to merge A1 and A2 in the shortest way, such that
A = [x1 y1
x2 y2
x3 y3
a1 b1
a2 b2
a3 b3
a4 b4]
Am weak when it comes to array indexing. I have implemented two for loops and some if statements to do this, but I feel there is a shortest way. Can you please help?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…