This commit is contained in:
2021-12-15 13:33:39 +01:00
parent aa773e761e
commit 7ea48928d5
6 changed files with 196 additions and 2 deletions

View File

@@ -30,9 +30,9 @@ def part_one(lines: list[str]) -> int:
stack = []
for char in list(line):
if char in CLOSING_FOR_OPEN.values(): # Open backets
if char in OPEN: # Open backets
stack.append(char)
elif char in CLOSING_FOR_OPEN: # Close brackets
elif char in CLOSE: # Close brackets
top = stack.pop()
if top != CLOSING_FOR_OPEN[char]: