diff --git a/day03.py b/day03.py index 80d2975..32c4fb8 100644 --- a/day03.py +++ b/day03.py @@ -1,5 +1,4 @@ from tools.aoc import AOCDay -from tools.tools import list_intersection from typing import Any @@ -27,7 +26,7 @@ class Day(AOCDay): def part1(self) -> Any: es = 0 for line in self.getInput(): - es += get_prio(list_intersection(line[:len(line)//2], line[len(line)//2:])[0]) + es += get_prio(line[:len(line)//2].intersection(line[len(line)//2:])) return es @@ -35,7 +34,7 @@ class Day(AOCDay): rucksacks = self.getInput() es = 0 for g in range(len(rucksacks) // 3): - es += get_prio(list_intersection(rucksacks[g*3], rucksacks[g*3+1], rucksacks[g*3+2])[0]) + es += get_prio(rucksacks[g*3].intersection(rucksacks[g*3+1], rucksacks[g*3+2])) return es