diff --git a/2021/day10/10.py b/2021/day10/10.py index 41c85e2..2b7aeb8 100644 --- a/2021/day10/10.py +++ b/2021/day10/10.py @@ -16,8 +16,9 @@ for l in lines: if c == '(' or c == '[' or c == '{' or c == '<': stack.append(c) if c == ')' or c == ']' or c == '}' or c == '>': - if stack.pop() != [x[0] for x in di if x[1] == c][0][0]: - score1 += [x for x in di if x[1] == c][0][2] + match = [x for x in di if x[1] == c][0] + if stack.pop() != match[0]: + score1 += match[2] valid = False break if valid: