更新时间:2023-02-01 17:20:30
[list1, list2].transpose()*.flatten()
假设list1
和list2
的基数相同.
更新
现在已经大大地修改了问题,但是可以通过如下扩展移调来获得想要的结果:
UPDATE
Question is modified drastically now, but you can get what you seek by extending the transpose as below:
[list1, list2].transpose()*.flatten()
.collect{[it[0], it[-2..-1], it[1..-3]]}*.flatten()