Groovy Method to combine list of lists
Solution 1:
Try flatten
, ie:
list.flatten()
Or, to get the output you want:
list = [[1,2,3], [6], [3,4,5,6]]
assert list.flatten().sort() == [1,2,3,3,4,5,6,6]
Try flatten
, ie:
list.flatten()
Or, to get the output you want:
list = [[1,2,3], [6], [3,4,5,6]]
assert list.flatten().sort() == [1,2,3,3,4,5,6,6]