🐛 Day 2: Fixed uh.-... simply wrong behaviour in part 2

This commit is contained in:
LeMoonStar 2024-12-02 22:05:03 +01:00
parent b2c8337177
commit 3b942efd71

View file

@ -22,12 +22,12 @@ impl Report {
if !Self::safe_comparison(self.0[i - 1], self.0[i], &mut direction) { if !Self::safe_comparison(self.0[i - 1], self.0[i], &mut direction) {
if tolerance > 0 { if tolerance > 0 {
if (i + 1 >= self.0.len()) { if i + 1 >= self.0.len() {
return true; return true;
} }
tolerance -= 1; 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; skip = true;
continue; continue;
} }