1 parent 3773dfe commit f50d998Copy full SHA for f50d998
4 files changed
aoc2025/day12.py
@@ -0,0 +1,13 @@
1
+from pathlib import Path
2
+
3
+lines = Path("aoc2025/day12input.txt").read_text().splitlines()
4
+tiles = ["".join(lines[start + 1 : start + 4]).count("#") for start in range(0, 30, 5)]
5
6
+count = 0
7
+for line in lines[30:]:
8
+ board, _, presents = line.rstrip().partition(": ")
9
+ height, _, width = board.partition("x")
10
+ count += sum(
11
+ tile * int(present) for tile, present in zip(tiles, presents.split())
12
+ ) < int(height) * int(width)
13
+print(count)
0 commit comments