We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 340504a commit 404b2abCopy full SHA for 404b2ab
src/day7.rs
@@ -85,15 +85,15 @@ fn search_part2(target: u64, v: &[NonZero<u64>]) -> bool {
85
return false;
86
}
87
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) {
+ if target % last == 0 {
+ if search_part2(target / last, rest) {
91
return true;
92
93
94
95
- if target % last == 0 {
96
- if search_part2(target / last, rest) {
+ let size = unsafe { NonZero::new_unchecked(10u64.pow(last.ilog10() + 1)) };
+ if (target - last) % size == 0 {
+ if search_part2((target - last) / size, rest) {
97
98
99
0 commit comments