[Python/2015] Move solutions into .py files
This commit is contained in:
parent
8c2be5fb77
commit
94dd3ae399
52 changed files with 996 additions and 3314 deletions
15
Python/2015/02.py
Normal file
15
Python/2015/02.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
from lib import *
|
||||
|
||||
input = read_input(2015, 2)
|
||||
|
||||
boxes = [sorted(map(int, line.split("x"))) for line in input.splitlines()]
|
||||
|
||||
total = 0
|
||||
for a, b, c in boxes:
|
||||
total += 2 * (a * b + a * c + b * c) + a * b
|
||||
print(total)
|
||||
|
||||
total = 0
|
||||
for a, b, c in boxes:
|
||||
total += 2 * (a + b) + a * b * c
|
||||
print(total)
|
Loading…
Add table
Add a link
Reference in a new issue