diff --git a/day23.py b/day23.py index b9e6ee7..241633f 100644 --- a/day23.py +++ b/day23.py @@ -11,7 +11,7 @@ class Cup: self.right = right -def buildDoubleLinkedListDict(cup_list): +def buildLinkedListDict(cup_list): cups = {} left_cup = None first_cup = None @@ -47,7 +47,7 @@ def play(cups, current_cup, max_label): def part1(test_mode=False): my_input = aoclib.getInputAs2DArray(day=DAY, return_type=int, test=test_mode) - cups, current_cup = buildDoubleLinkedListDict(my_input[0]) + cups, current_cup = buildLinkedListDict(my_input[0]) for _ in range(100): cups, current_cup = play(cups, current_cup, 9) @@ -63,7 +63,7 @@ def part1(test_mode=False): def part2(test_mode=False): my_input = aoclib.getInputAs2DArray(day=DAY, return_type=int, test=test_mode) - cups, current_cup = buildDoubleLinkedListDict(my_input[0] + list(range(max(my_input[0]) + 1, 1000001))) + cups, current_cup = buildLinkedListDict(my_input[0] + list(range(max(my_input[0]) + 1, 1000001))) for _ in range(10000000): cups, current_cup = play(cups, current_cup, 1000000)