1
0
Fork 0
advent-of-code/2015/aoc_d2p2.py

14 lines
260 B
Python
Raw Permalink Normal View History

2024-02-08 09:55:40 +01:00
#!/usr/bin/env python
total = 0
with open("inputd2.txt", "r") as f:
for line in f:
dimensions = sorted([int(x) for x in line.split("x")])
l = dimensions[0]
w = dimensions[1]
h = dimensions[2]
total += (2 * l) + (2 * w) + (l * w * h)
print(total)