mirror of
https://github.com/balkian/gists.git
synced 2025-04-10 23:19:23 +00:00
git-subtree-dir: repos/9186599 git-subtree-mainline: 44c3bd604a11740ed442a7a38cccaf801a6a4b5e git-subtree-split: 78198af80421c8a6ab12609bd58b3483a77da5d6
11 lines
394 B
Plaintext
11 lines
394 B
Plaintext
def array_combinations(*args):
|
|
combinations = set([frozenset([i]) for i in set(args[0])])
|
|
for arg in args[1:]:
|
|
tempcomb = []
|
|
for i in set(arg):
|
|
tempcomb += [frozenset(list(c)+[i]) for c in combinations if i not in c ]
|
|
combinations = set(tempcomb)
|
|
return [list(comb) for comb in combinations]
|
|
res = array_combinations(a,b)
|
|
print res
|
|
print len(res) |