From 543d0823c38af3869581cfe87420be7840a37246 Mon Sep 17 00:00:00 2001 From: Ruediger Ludwig Date: Sun, 4 Dec 2022 08:26:11 +0100 Subject: [PATCH] improved day04 (thanks to Heiko) --- advent/days/day04/solution.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/advent/days/day04/solution.py b/advent/days/day04/solution.py index 09d6217..e221fe5 100644 --- a/advent/days/day04/solution.py +++ b/advent/days/day04/solution.py @@ -31,8 +31,7 @@ class Range: def overlap(self, other: Range) -> bool: """ Check if this range obverlaps with the other """ - return (self.start >= other.start and self.start <= other.end) or ( - other.start >= self.start and other.start <= self.end) + return self.start <= other.end and other.start <= self.end @dataclass(slots=True, frozen=True)