作者:杀手也热血_949 | 来源:互联网 | 2023-09-16 14:21
Suppose I have two arrays:
假设我有两个数组:
a = ["Fruit", "Emu", "Color"]
b = ["Banana", "Name", "Orange"]
I want to insert b
array values into random positions of a
. A possible output for these two arrays would be:
我想将b数组值插入a的随机位置。这两个数组的可能输出是:
c = ["Banana", "Fruit", "Emu", "Color", "Orange", "Name"]
Here, b
array values are inserted into a
, but the value sequence
这里,b数组值被插入a,但是值序列
"Fruit"
→ "Emu"
→ "Color"
“水果”→“鸸”“→”颜色“
of a
is not hampered. How can I do that?
一个没有受到阻碍。我怎样才能做到这一点?
3 个解决方案