advent_of_code_2024::day_9

Function pack_files

source
fn pack_files(
    disk_map: &VecDeque<DiskUsage>,
    space_filler: fn(_: &mut Vec<File>, _: &mut VecDeque<DiskUsage>, _: Space, _: File),
) -> Vec<File>
Expand description

The common logic for reading from both ends of the disk usage map, outputting files as their final position becomes known.