From 3f5437e3838dc84c83cfa4877d930dba0ab5d3ef Mon Sep 17 00:00:00 2001 From: Pascal Lais Date: Tue, 21 Dec 2021 16:35:27 +0100 Subject: [PATCH] Update day 21 solution --- day-21/day-21.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/day-21/day-21.py b/day-21/day-21.py index 6c92b95..5d63e5a 100644 --- a/day-21/day-21.py +++ b/day-21/day-21.py @@ -24,9 +24,7 @@ def quantum_roll(state, p0, p1, s0, s1): def part_1(input): result = 0 - pos = [] - pos.append(int(input[0].rstrip().split()[-1]) - 1) - pos.append(int(input[1].rstrip().split()[-1]) - 1) + pos = [int(line.rstrip().split()[-1]) - 1 for line in input] score = [0, 0] p = 0 dice = 1 @@ -48,8 +46,7 @@ def part_1(input): def part_2(input): result = 0 state = {} - p0 = int(input[0].rstrip().split()[-1]) - 1 - p1 = int(input[1].rstrip().split()[-1]) - 1 + p0, p1 = [int(line.rstrip().split()[-1]) - 1 for line in input] result = max(quantum_roll(state, p0, p1, 0, 0)) print("Part 2 result:", result)