0
0
Fork 0

Add code for 2015 advent that I did historically.

This commit is contained in:
Oliver-Akins 2020-12-06 20:33:17 -07:00
parent 13968ed94e
commit 9e9e556c73
25 changed files with 598 additions and 0 deletions

16
day_2/part_2.py Normal file
View file

@ -0,0 +1,16 @@
ribbon_sum = 0
with open("input", "r") as data:
for line in data:
dimensions = line.split("x")
l, w, h = [int(x) for x in dimensions]
min_perimeter = min(l+l+w+w, l+l+h+h, h+h+w+w)
volume = l * w * h
ribbon_sum += min_perimeter + volume
print(ribbon_sum)