aboutsummaryrefslogtreecommitdiff
path: root/2022
diff options
context:
space:
mode:
authorMarvin Borner2022-12-14 10:57:12 +0100
committerMarvin Borner2022-12-14 10:57:12 +0100
commit8555df67e6830f5879fa1803d12cf9c4f0132c2f (patch)
tree87db3d7a06c86f23a612b123f91da45865471ab9 /2022
parent058192c3a3be4ddda8bff866820c4b8defe8d302 (diff)
better
Diffstat (limited to '2022')
-rw-r--r--2022/14/solve.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/2022/14/solve.py b/2022/14/solve.py
index d327e85..ce78423 100644
--- a/2022/14/solve.py
+++ b/2022/14/solve.py
@@ -56,10 +56,7 @@ def solve(grounded):
rocks(grid, line)
if grounded:
- ground = max(
- max([i for i, y in enumerate(col) if y == ROCK], default=0)
- for col in grid
- )
+ ground = max(y for _, y in sum(data, []))
for x in range(X):
grid[x][ground + 2] = ROCK