commit f191ccf557b5324f9589abb5fac9eab79ce3a303 Author: J. Fernando Sánchez Date: Mon Feb 24 03:18:39 2014 -0800 diff --git a/Array combinations b/Array combinations new file mode 100644 index 0000000..65fe445 --- /dev/null +++ b/Array combinations @@ -0,0 +1,10 @@ +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) \ No newline at end of file