From 8e53a94312795de24cc975be3603ead7ef8f9cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Fuglede=20J=C3=B8rgensen?= Date: Thu, 26 Dec 2024 15:08:09 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=84=20Add=20solution=20to=202024-12-25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2024/day25/solutions.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 2024/day25/solutions.py diff --git a/2024/day25/solutions.py b/2024/day25/solutions.py new file mode 100644 index 0000000..221faa2 --- /dev/null +++ b/2024/day25/solutions.py @@ -0,0 +1,12 @@ +from itertools import combinations + +with open("input") as f: + gs = f.read().strip().split("\n\n") + +# Part 1 +print( + sum( + g1[0] != g2[0] and not any({x1, x2} == {"#"} for x1, x2 in zip(g1, g2)) + for g1, g2 in combinations(gs, 2) + ) +)