add: files so far

This commit is contained in:
Charles
2024-12-02 23:04:39 -08:00
commit 79d1618ede
34 changed files with 953 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
Advent of code 2024
Day 1
Usage:
rustc d1p1.rs
cat input.txt | ./d1p1
Part 1:
Parse each line into a pair of ints; store them in a pair of heaps.
Convert heaps into sorted lists. Iterate through them together
and find the absolute difference between each pair of numbers.
Part 2:
Parse each line into a pair of ints; store the first in an array,
place the second into a map that accumulate the number of times
a value is seen.
Iterate through the array, adding the number times the number of
times it was seen in the map.