2015 day 2 part 1 refactor

This commit is contained in:
2024-12-06 20:59:43 +01:00
parent 517eaffde5
commit 535a581bb3

View File

@@ -7,8 +7,11 @@ count = 0
for line in input.splitlines(): for line in input.splitlines():
[x, y, z] = sorted(map(int, line.split("x"))) [x, y, z] = sorted(map(int, line.split("x")))
areaX = x * y * 2
areaY = y * z * 2 areaX = x * y
areaZ = x * z * 2 areaY = y * z
count += areaX + areaY + areaZ + x * y areaZ = x * z
count += (areaX + areaY + areaZ) * 2 + areaX
print(count) print(count)