Skip to content

Commit

Permalink
Update day12.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall authored Dec 12, 2023
1 parent 5b7466a commit f2cb6ed
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions crates/core/src/year2023/day12.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ fn count_alternatives(damaged: u128, unknown: u128, groups: &[u8]) -> u64 {
// with bits set at positions up until the first damaged position
// - note that we inserted an unset bit above.
let mut alternatives = [0; 128];
for i in 0..damaged.trailing_zeros() {
alternatives[i as usize] = 1;
}
(&mut alternatives[0..(damaged.trailing_zeroes() as usize)]).fill(1);

// For each group that is necessary, go over all the positions
// and carry over possibilities from the previous run at positions
Expand Down

0 comments on commit f2cb6ed

Please sign in to comment.