From 455d815d0d810b20e923b6e20fd62199ad238c10 Mon Sep 17 00:00:00 2001 From: Domenico Testa Date: Mon, 2 Dec 2024 12:43:55 +0100 Subject: [PATCH] chore: formatting with ruff --- day_1/main.py | 5 ++--- day_2/main.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/day_1/main.py b/day_1/main.py index dfb23ad..4236717 100644 --- a/day_1/main.py +++ b/day_1/main.py @@ -5,8 +5,8 @@ from typing import Generator, TextIO, Tuple def read_input(f: TextIO) -> Generator[Tuple[int, int], None, None]: for line in f: - x, y = line.strip().split() - yield (int(x), int(y)) + x, y = line.strip().split() + yield (int(x), int(y)) def total_distance() -> int: @@ -25,7 +25,6 @@ def total_distance() -> int: return total_distance - def similarity_score() -> int: left = [] right = [] diff --git a/day_2/main.py b/day_2/main.py index 74804a6..2c71f20 100644 --- a/day_2/main.py +++ b/day_2/main.py @@ -3,7 +3,7 @@ from typing import List, TextIO def read_input(f: TextIO) -> List[int]: for line in f: - yield [int(n) for n in line.strip().split()] + yield [int(n) for n in line.strip().split()] def is_safe(report: List[int]) -> bool: @@ -52,8 +52,8 @@ def count_safe_reports_with_tolerance(f: TextIO) -> int: safe = is_safe(report) if not safe: - for n in range(1, len(report)+1): - safe = is_safe(report[0:n-1] + report[n:]) + for n in range(1, len(report) + 1): + safe = is_safe(report[0 : n - 1] + report[n:]) if safe: break