Skip to content

Commit

Permalink
[2024/7] tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlitGhost committed Dec 7, 2024
1 parent 7521067 commit 9c8932c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 2024/7/script.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from GhostyUtils import aoc
import operator
import itertools
from typing import Iterable, Callable
from typing import Callable


def calibrate(target: int, operands: list[int], operators: Iterable[Callable]) -> int:
def calibrate(target: int, operands: list[int], operators: list[Callable]) -> int:
# try all operators in all positions between operands
for ops in itertools.product(operators, repeat=len(operands)-1):
# calculate left-to-right
Expand Down Expand Up @@ -45,7 +45,7 @@ def main():
p2total += calibrate(target, operands, [operator.add, operator.mul, concat])

print(f"p1: {total}")
print(f"p2: {total+p2total}")
print(f"p2: {total + p2total}")


if __name__ == "__main__":
Expand Down

0 comments on commit 9c8932c

Please sign in to comment.