From 050429ce6c664a0944c91363c90b20900e5811c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Engl=C3=B6f=20Ytterstr=C3=B6m?= Date: Sun, 14 Dec 2025 22:41:23 +0100 Subject: [PATCH] Solve 2025 day 12 pt 1-2 Got this one ruined due to a post not masking spoilers: https://www.reddit.com/r/adventofcode/comments/1pkxibs/2025_day_25_part_1_still_pretty_clueless_why_its/ Basically, ignore the test case and just wing it by asuming the 3x3 can be placed without overlaps. Id the number of shapes * 3x3 is bigger than the available canvas, it won't fit. A naive first check to do before making premature optimizations. I would have gone the zip() hell route to prove it actually works, but after grasping at the puzzle input i realized it would tka a looong time to calculate. --- 2025-python/output/day_12.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 2025-python/output/day_12.py diff --git a/2025-python/output/day_12.py b/2025-python/output/day_12.py new file mode 100644 index 0000000..c80a34a --- /dev/null +++ b/2025-python/output/day_12.py @@ -0,0 +1,26 @@ +from output import ints + + +def solve(data): + p1 = 0 + data = data.split("\n\n") + Q = data.pop().splitlines() + for q in Q: + W, H, *C = ints(q) + if W * H >= sum(C) * 9: + p1 += 1 + p2 = "God jul!" + return p1, p2 + + +if __name__ == "__main__": + with open("./input/12.txt", "r") as f: + inp = f.read().strip() + + p1, p2 = solve(inp) + + print(p1) + print(p2) + + assert p1 == 440 + assert p2 == "God jul!"