Skip to content

Commit

Permalink
Even further optimize 2024 day 20
Browse files Browse the repository at this point in the history
  • Loading branch information
ictrobot committed Dec 20, 2024
1 parent ba81e89 commit cb4f58f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/year2024/src/day20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ impl Day20 {
let this_distance = self.distances[index];
let target_distance = self.distances[target];
cheats += u16::from(
(target_distance != u16::MAX)
& (target_distance
.saturating_sub(this_distance)
.saturating_sub(cheat_length)
>= 100),
target_distance
.wrapping_add(1)
.saturating_sub(this_distance)
.saturating_sub(cheat_length)
>= 101,
);
}
cheats as u32
Expand Down

0 comments on commit cb4f58f

Please sign in to comment.