Skip to content

Commit

Permalink
day_8 part_2 clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
0qln committed Dec 8, 2024
1 parent c62a294 commit ca49349
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/day_8/part_2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ pub fn solve(input: &str) -> usize {
].iter() {
let mut dist = 0;
while {
let d = mul(*d, dist);
dist += 1;
let anti_node = setoff(antenna, d);
let anti_node = setoff(antenna, mul(*d, dist));
anti_nodes.set_checked(anti_node, '#').is_some()
} {}
} { dist += 1; }
}
}
}
}
anti_nodes.count(|&ch| matches!(ch, '#'))
anti_nodes.count(|&ch| ch == '#')
}

0 comments on commit ca49349

Please sign in to comment.