From 8d1a80879159191d68a67f4e09731fe9a3a96c3b Mon Sep 17 00:00:00 2001 From: Stegallo Date: Sat, 7 Dec 2024 16:48:53 -0800 Subject: [PATCH] cleanup 7 --- y_2024/day7.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/y_2024/day7.py b/y_2024/day7.py index 2ac8ac2..7f2c5b2 100644 --- a/y_2024/day7.py +++ b/y_2024/day7.py @@ -1,19 +1,19 @@ -from typing import Optional +from typing import Optional, Callable from pydantic.dataclasses import dataclass from common.aoc import AoCDay -def add(a, b): +def add(a: int, b: int) -> int: return a + b -def mul(a, b): +def mul(a: int, b: int) -> int: return a * b -def conc(a, b): +def conc(a: int, b: int) -> int: return int(str(a) + str(b)) @@ -27,7 +27,7 @@ def __post_init__(self) -> None: self.result = int(self.original.split(": ")[0]) self.op_list = [int(i) for i in self.original.split(": ")[1].split(" ")] - def do(self, lst: list[int], ops: list) -> bool: + def do(self, lst: list[int], ops: list[Callable]) -> bool: if len(lst) == 1: return lst[0] == self.result