Update day 10 solution
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-12-10 08:50:14 +01:00
parent 124eed1c1f
commit 8c0e9e4bda

View File

@@ -27,19 +27,18 @@ def part_1(input):
def part_2(input): def part_2(input):
result = 0 result = 0
lines = input.copy()
scores = [] scores = []
for line in input: for line in input.copy():
seen = [] seen = []
for c in line.rstrip(): for c in line.rstrip():
if c in o_chars: if c in o_chars:
seen.append(c) seen.append(c)
elif o_chars.index(seen[-1]) != c_chars.index(c): elif o_chars.index(seen[-1]) != c_chars.index(c):
lines.remove(line) input.remove(line)
break break
else: else:
del seen[-1] del seen[-1]
for line in lines: for line in input:
seen = [] seen = []
for c in line.rstrip(): for c in line.rstrip():
if c in o_chars: if c in o_chars: