diff --git a/aoc_25/solutions/day01.py b/aoc_25/solutions/day01.py index 04a7406..e7bacd6 100644 --- a/aoc_25/solutions/day01.py +++ b/aoc_25/solutions/day01.py @@ -1,4 +1,5 @@ """Day 1 - Secret Entrance""" + from typing import Any from utils.aoc_utils import report_results, AoCResult, input_for_day @@ -13,9 +14,9 @@ "L1", "L99", "R14", - "L82" + "L82", ] -DATA = input_for_day(1, 2025, ff='list') +DATA = input_for_day(1, 2025, ff="list") def parse_input(data: list[str]) -> tuple[int, int]: @@ -28,26 +29,29 @@ def parse_input(data: list[str]) -> tuple[int, int]: tuple[int, int]: land on zero, click over zero. """ zero_counter: int = 0 - # click_over_count: int = 0 + click_over_count: int = 0 start: int = 50 + pos: int = 50 for x in data: # assuming data will always be in a valid format direction, num = x[0], int(x[1:]) - # print(direction, num) + prev_pos: int = pos - if direction == 'L': - start -= num - else: - start += num + if direction == "L": + pos -= num + click_over_count += (-pos) // 100 - (-prev_pos) // 100 - start %= 100 + else: + pos += num + click_over_count += pos // 100 - prev_pos // 100 + start = pos % 100 if start == 0: # lands on zero following a turn zero_counter += 1 - return zero_counter, 0 + return zero_counter, click_over_count @report_results @@ -56,7 +60,7 @@ def solveday(data: list[str]) -> AoCResult: return p1, p2 -expected_test_results: AoCResult = (3, 0) +expected_test_results: AoCResult = (3, 6) def tests(test_input: Any) -> None: diff --git a/aoc_25/solutions/day02.py b/aoc_25/solutions/day02.py index 93e9ed7..7f9b69d 100644 --- a/aoc_25/solutions/day02.py +++ b/aoc_25/solutions/day02.py @@ -1,4 +1,5 @@ """Day 2 - Title Goes Here""" + from typing import Any from utils.aoc_utils import input_for_day, report_results, AoCResult diff --git a/aoc_25/solutions/day03.py b/aoc_25/solutions/day03.py index f8fd4e2..a99dd7d 100644 --- a/aoc_25/solutions/day03.py +++ b/aoc_25/solutions/day03.py @@ -1,4 +1,5 @@ """Day 3 - Title Goes Here""" + from typing import Any from utils.aoc_utils import input_for_day, report_results, AoCResult diff --git a/aoc_25/solutions/day04.py b/aoc_25/solutions/day04.py index 15d471e..b9ba0df 100644 --- a/aoc_25/solutions/day04.py +++ b/aoc_25/solutions/day04.py @@ -1,4 +1,5 @@ """Day 4 - Title Goes Here""" + from typing import Any from utils.aoc_utils import input_for_day, report_results, AoCResult diff --git a/aoc_25/solutions/day05.py b/aoc_25/solutions/day05.py index 9d6aba5..497db02 100644 --- a/aoc_25/solutions/day05.py +++ b/aoc_25/solutions/day05.py @@ -1,4 +1,5 @@ """Day 5 - Title Goes Here""" + from typing import Any from utils.aoc_utils import input_for_day, report_results, AoCResult diff --git a/aoc_25/solutions/day06.py b/aoc_25/solutions/day06.py index 1aa5535..1868f54 100644 --- a/aoc_25/solutions/day06.py +++ b/aoc_25/solutions/day06.py @@ -1,4 +1,5 @@ """Day 6 - Title Goes Here""" + from typing import Any from utils.aoc_utils import input_for_day, report_results, AoCResult diff --git a/aoc_25/solutions/day07.py b/aoc_25/solutions/day07.py index 382fd49..c18940e 100644 --- a/aoc_25/solutions/day07.py +++ b/aoc_25/solutions/day07.py @@ -1,4 +1,5 @@ """Day 7 - Title Goes Here""" + from typing import Any from utils.aoc_utils import input_for_day, report_results, AoCResult diff --git a/aoc_25/solutions/day08.py b/aoc_25/solutions/day08.py index a846f82..43375e5 100644 --- a/aoc_25/solutions/day08.py +++ b/aoc_25/solutions/day08.py @@ -1,4 +1,5 @@ """Day 8 - Title Goes Here""" + from typing import Any from utils.aoc_utils import input_for_day, report_results, AoCResult diff --git a/aoc_25/solutions/day09.py b/aoc_25/solutions/day09.py index 80c9d43..a5b1870 100644 --- a/aoc_25/solutions/day09.py +++ b/aoc_25/solutions/day09.py @@ -1,4 +1,5 @@ """Day 9 - Title Goes Here""" + from typing import Any from utils.aoc_utils import input_for_day, report_results, AoCResult diff --git a/aoc_25/solutions/day10.py b/aoc_25/solutions/day10.py index cbdb760..0fd558f 100644 --- a/aoc_25/solutions/day10.py +++ b/aoc_25/solutions/day10.py @@ -1,4 +1,5 @@ """Day 10 - Title Goes Here""" + from typing import Any from utils.aoc_utils import input_for_day, report_results, AoCResult diff --git a/aoc_25/solutions/day11.py b/aoc_25/solutions/day11.py index 0e0a729..dfc502a 100644 --- a/aoc_25/solutions/day11.py +++ b/aoc_25/solutions/day11.py @@ -1,4 +1,5 @@ """Day 11 - Title Goes Here""" + from typing import Any from utils.aoc_utils import input_for_day, report_results, AoCResult diff --git a/aoc_25/solutions/day12.py b/aoc_25/solutions/day12.py index bead4ca..1b43de1 100644 --- a/aoc_25/solutions/day12.py +++ b/aoc_25/solutions/day12.py @@ -1,4 +1,5 @@ """Day 12 - Title Goes Here""" + from typing import Any from utils.aoc_utils import input_for_day, report_results, AoCResult