Skip to content

Commit 404b2ab

Browse files
committed
Revert "Reorder part 2"
This reverts commit 340504a.
1 parent 340504a commit 404b2ab

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/day7.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ fn search_part2(target: u64, v: &[NonZero<u64>]) -> bool {
8585
return false;
8686
}
8787

88-
let size = unsafe { NonZero::new_unchecked(10u64.pow(last.ilog10() + 1)) };
89-
if (target - last) % size == 0 {
90-
if search_part2((target - last) / size, rest) {
88+
if target % last == 0 {
89+
if search_part2(target / last, rest) {
9190
return true;
9291
}
9392
}
9493

95-
if target % last == 0 {
96-
if search_part2(target / last, rest) {
94+
let size = unsafe { NonZero::new_unchecked(10u64.pow(last.ilog10() + 1)) };
95+
if (target - last) % size == 0 {
96+
if search_part2((target - last) / size, rest) {
9797
return true;
9898
}
9999
}

0 commit comments

Comments
 (0)