给出n个随机大小的数组,我需要像这样对它们进行置换:
[a1, a2, a3]
[b1, b2]
[c1, c2]
[a1, b1, c1]
[a1, b1, c2]
[a1, b2, c1]
[a1, b2, c2]
[a2, b1, c1]
[a2, b1, c2]
[a2, b2, c1]
[a2, b2, c2]
[a3, b1, c1]
[a3, b1, c2]
[a3, b2, c1]
[a3, b2, c2]
列顺序很重要,行无关。
什么是实现此目标的好方法。如果可能,请使用以下方法进行合同:
<T> List<List<T>> permute(List<T>... lists)