clean up 16

This commit is contained in:
timeshifter
2026-07-02 15:24:20 +02:00
parent c3930d2573
commit d39cc86d4d
2 changed files with 8 additions and 7 deletions
+3
View File
@@ -5,3 +5,6 @@ edition = "2024"
[dependencies]
itertools = "*"
[profile.release]
debug = true
+5 -7
View File
@@ -19,16 +19,14 @@ fn main() {
fn calculate_checksum(length: usize) {
let mut a = INPUT.to_string();
while a.len() < length {
let mut b = a.clone();
b = b
.chars()
.rev()
.map(|c| if c == '0' { '1' } else { '0' })
.collect();
let b = a.clone();
let b_chars = b.chars().rev().map(|c| if c == '0' { '1' } else { '0' });
let mut result = a.clone();
result.push('0');
result.push_str(&b);
for ch in b_chars {
result.push(ch);
}
a = result;
}
a.truncate(length);