Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 13, 2025
1 parent db45798 commit 156f7f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion solutions/aoc2023/01.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def part1(self) -> int:

def part2(self) -> int:
pattern = re.compile(
rf'(?=(\d|{"|".join(DIGITS)}))'
rf"(?=(\d|{'|'.join(DIGITS)}))"
) # positive lookahead for match overlaps
total = 0
for line in self.input():
Expand Down
2 changes: 1 addition & 1 deletion solutions/aoc2023/13.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def find_flip(pattern: Pattern) -> int:
for i in range(len(pattern)):
for j in range(len(pattern[0])):
old_str = pattern[i]
pattern[i] = f"{old_str[:j]}{flip[old_str[j]]}{old_str[j + 1:]}"
pattern[i] = f"{old_str[:j]}{flip[old_str[j]]}{old_str[j + 1 :]}"
new_scores = scores(pattern)
diff = new_scores - old_scores
if diff:
Expand Down

0 comments on commit 156f7f0

Please sign in to comment.