From 86680b4174b34096c6944c339e52f14db43ef187 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 24 Dec 2024 09:20:59 +0000 Subject: [PATCH] Finished day 4 --- day4/run.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/day4/run.py b/day4/run.py index e789831..6c4edc7 100644 --- a/day4/run.py +++ b/day4/run.py @@ -28,7 +28,7 @@ class FindXMAS: @property def _part2(self) -> int: - return len(self.locate_x_mas()) + return len(self.locate_x_mas()) // 2 @staticmethod def _to_grid(input: str) -> List[List[str]]: @@ -98,13 +98,14 @@ class FindXMAS: if loc[1] in oth: locations.append(loc) - return mas + return locations if __name__ == "__main__": example = FindXMAS(EXAMPLE) print(example) assert example._part1 == 18 + assert example._part2 == 9 with open("input.txt", "r") as f: puzzle = FindXMAS(f.read()) print(puzzle)