From c3cd07ca7b1fac38a89040a7d914334e9980497a Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Sat, 3 Dec 2022 08:09:31 +0100 Subject: [PATCH] day03 - utilizing fishhook --- day03.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/day03.py b/day03.py index 32c4fb8..725b990 100644 --- a/day03.py +++ b/day03.py @@ -26,7 +26,7 @@ class Day(AOCDay): def part1(self) -> Any: es = 0 for line in self.getInput(): - es += get_prio(line[:len(line)//2].intersection(line[len(line)//2:])) + es += get_prio(line[:len(line)//2] & line[len(line)//2:]) return es @@ -34,7 +34,7 @@ class Day(AOCDay): rucksacks = self.getInput() es = 0 for g in range(len(rucksacks) // 3): - es += get_prio(rucksacks[g*3].intersection(rucksacks[g*3+1], rucksacks[g*3+2])) + es += get_prio(rucksacks[g*3] & rucksacks[g*3+1] & rucksacks[g*3+2]) return es