advent-of-code/2015/02/part02.py

15 lines
289 B
Python
Raw Normal View History

2021-12-01 11:07:21 +01:00
with open("input") as f:
puzzle_input = [n.strip() for n in f.readlines()]
ribbon = 0
for present_dim in puzzle_input:
parsed_dim = [int(x) for x in present_dim.split("x")]
parsed_dim.sort()
[l, w, h] = parsed_dim
ribbon += 2 * l + 2 * w + l * w * h
print(ribbon)