From 3b942efd71bb5bf51b057ff5f4ca8001b9b7d71e Mon Sep 17 00:00:00 2001 From: LeMoonStar Date: Mon, 2 Dec 2024 22:05:03 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Day=202:=20Fixed=20uh.-...=20sim?= =?UTF-8?q?ply=20wrong=20behaviour=20in=20part=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/days/d02.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/days/d02.rs b/src/days/d02.rs index 009d2bc..6e95a92 100644 --- a/src/days/d02.rs +++ b/src/days/d02.rs @@ -22,12 +22,12 @@ impl Report { if !Self::safe_comparison(self.0[i - 1], self.0[i], &mut direction) { if tolerance > 0 { - if (i + 1 >= self.0.len()) { + if i + 1 >= self.0.len() { return true; } tolerance -= 1; - if !Self::safe_comparison(self.0[i - 1], self.0[i + 1], &mut direction) { + if Self::safe_comparison(self.0[i - 1], self.0[i + 1], &mut direction) { skip = true; continue; }