mirror of
https://github.com/ershisan99/advent-of-code.git
synced 2025-12-16 12:32:49 +00:00
2015 day 2 part 1 refactor
This commit is contained in:
@@ -7,8 +7,11 @@ count = 0
|
||||
|
||||
for line in input.splitlines():
|
||||
[x, y, z] = sorted(map(int, line.split("x")))
|
||||
areaX = x * y * 2
|
||||
areaY = y * z * 2
|
||||
areaZ = x * z * 2
|
||||
count += areaX + areaY + areaZ + x * y
|
||||
|
||||
areaX = x * y
|
||||
areaY = y * z
|
||||
areaZ = x * z
|
||||
|
||||
count += (areaX + areaY + areaZ) * 2 + areaX
|
||||
|
||||
print(count)
|
||||
|
||||
Reference in New Issue
Block a user