aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-067/walt-mankowski/python/ch-1.py7
-rw-r--r--challenge-067/walt-mankowski/python/ch-2.py17
2 files changed, 24 insertions, 0 deletions
diff --git a/challenge-067/walt-mankowski/python/ch-1.py b/challenge-067/walt-mankowski/python/ch-1.py
new file mode 100644
index 0000000000..83b9cd47dd
--- /dev/null
+++ b/challenge-067/walt-mankowski/python/ch-1.py
@@ -0,0 +1,7 @@
+from sys import argv
+from itertools import combinations
+
+m, n = [int(x) for x in argv[1:]]
+it = combinations(range(1,m+1), n)
+combs = [comb for comb in it]
+print(combs)
diff --git a/challenge-067/walt-mankowski/python/ch-2.py b/challenge-067/walt-mankowski/python/ch-2.py
new file mode 100644
index 0000000000..5cb94cfa10
--- /dev/null
+++ b/challenge-067/walt-mankowski/python/ch-2.py
@@ -0,0 +1,17 @@
+from sys import argv
+from itertools import product
+
+key = {'1': '_@',
+ '2': 'ABC',
+ '3': 'DEF',
+ '4': 'GHI',
+ '5': 'JKL',
+ '6': 'MNO',
+ '7': 'PQRS',
+ '8': 'TUV',
+ '9': 'WXYZ',
+ '0': ' ',
+ }
+
+s = argv[1]
+print([''.join(p) for p in product(*[key[c] for c in s])])