Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/day9.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ unsafe fn inner1(s: &[u8]) -> usize {
macro_rules! insert_file {
($len:expr, $id:expr) => {
let len = $len;
checksum += (disk_pos * 2 + len - 1) * $id * len / 2;
checksum += (disk_pos * 2 + len - 1) * $id * len;
disk_pos += len;
};
}
Expand Down Expand Up @@ -50,7 +50,7 @@ unsafe fn inner1(s: &[u8]) -> usize {

insert_file!(rem_src, left);

checksum
checksum / 2
}

pub fn part1(s: &str) -> impl Display {
Expand Down
Loading