1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-22 01:32:29 +00:00
gists/Array combinations

10 lines
313 B
Plaintext
Raw Normal View History

2014-02-24 11:18:39 +00:00
def array_combinations(*args):
combinations = [[i] for i in args[0]]
for arg in args[1:]:
tempcomb = []
for i in arg:
tempcomb += [c+[i] for c in combinations if i not in c ]
combinations = tempcomb
return combinations
res = array_combinations(a,b,c)
print len(res)