summaryrefslogtreecommitdiffstats
path: root/2/2.py
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-11-24 22:25:42 +0000
committerTomasz Kramkowski <tk@the-tk.com>2021-11-24 22:25:42 +0000
commita7a6b86002b595bc167af72606b14c67ed1bdf8f (patch)
treebff94329cf969bd9df68d3b9782fee2107db56c2 /2/2.py
downloadaoc2015-a7a6b86002b595bc167af72606b14c67ed1bdf8f.tar.gz
aoc2015-a7a6b86002b595bc167af72606b14c67ed1bdf8f.tar.xz
aoc2015-a7a6b86002b595bc167af72606b14c67ed1bdf8f.zip
init commit
Diffstat (limited to '2/2.py')
-rw-r--r--2/2.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/2/2.py b/2/2.py
new file mode 100644
index 0000000..808c999
--- /dev/null
+++ b/2/2.py
@@ -0,0 +1,4 @@
+from itertools import combinations
+from functools import reduce
+from operator import mul
+print(sum(2 * (sum(box) - max(box)) + reduce(mul, box) for box in ([int(x) for x in l.split('x')] for l in open('input'))))