mirror of
https://github.com/ershisan99/advent-of-code.git
synced 2025-12-16 20:49:24 +00:00
2015 day 2 part 1 refactor
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user