Skip to content

Commit

Permalink
2023: Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
jp7677 committed Dec 20, 2023
1 parent e234f50 commit 9f4fa0a
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions 2023/src/day13.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ fn find_reflection(map: &HashSet<Coord>, diff: usize) -> (u32, u32) {
})
.collect::<HashSet<_>>();

if a.symmetric_difference(&b.iter().collect::<HashSet<_>>())
.collect::<HashSet<_>>()
.len()
== diff
{
if a.symmetric_difference(&b.iter().collect()).count() == diff {
return (i as u32, 0);
}
}
Expand All @@ -74,14 +70,9 @@ fn find_reflection(map: &HashSet<Coord>, diff: usize) -> (u32, u32) {
x: c.x,
y: i - (c.y - i + 1),
})
.into_iter()
.collect::<HashSet<_>>();

if a.symmetric_difference(&b.iter().collect::<HashSet<_>>())
.collect::<HashSet<_>>()
.len()
== diff
{
if a.symmetric_difference(&b.iter().collect()).count() == diff {
return (0, i as u32);
}
}
Expand Down

0 comments on commit 9f4fa0a

Please sign in to comment.