Advent-of-Code/2015/day 2/P2/ribbon.py

7 lines
181 B
Python
Raw Normal View History

2019-12-01 17:44:00 +01:00
boxs = open("input.txt").read().split("\n")[:-1]
ribbon = 0
for i in boxs:
i = sorted([int(j) for j in i.split("x")])
ribbon+=(i[0]*2+i[1]*2)+(i[0]*i[1]*i[2])
print(ribbon)