Commit graph

16 commits

Author SHA1 Message Date
a184bc3dc1 feat: solve day 8 part 1 2026-01-07 22:20:25 +01:00
Jacob Jonsson
57df8af079
chore: add stack 2026-01-07 14:37:23 +01:00
d8824fd6bd feat: solve day 7
We parse the grid and then step through a simulation of the tachyon
beam's spread and count the number of splitters that the beam actually
hit.
2025-12-20 10:55:01 +01:00
7b7dd2660b chore(day6): add todo for cleaning 2025-12-07 21:10:55 +01:00
a64400efd8 feat: solve day6 part 2
Read the numbers from a given column and multiply each partial sum
with 10, to go from (0, [1, 2, 3]) -> (1, [2, 3]) -> (10 + 2, [3]) ->
(120 + 3, []) -> 120.
2025-12-07 16:36:40 +01:00
02927269a8 feat: solve day6, part 1
For the first part of day 6 we parse each word on each line as either
a number or as an operator (multiplication or addition). We then order
them all by column and calculate the final value once we have all
numbers and the operator.

Most of the work takes place in the parsing function, the rest is just
summing it all up.
2025-12-06 08:25:55 +01:00
7af90f9e9c feat: solve day 5, part 2
Keeping the old solution for the ranges was too ineffective when it
came to enumerating all contained integers, the amount of elements was
too large to either expand the ranges into Sets or similar.

However, it turned out (after some thinking) to be fairly
straight-forward to check if consecutive ranges overlapped, and in
that case merge them. The solution therefore now parses the ranges,
sorts them on the first component and then merges them as far as
possible.

changes: JJ: M app/Day5.hs
2025-12-05 22:55:51 +01:00
19e994ef71 feat: solve part 1 day 5 2025-12-05 21:51:10 +01:00
8e780753c1 feat: solve day4 part 2
Part two is solved by repeatedly removing all free rolls until there
are no more rolls to remove. When removing the rolls we keep a running
count of how many rolls we've removed.
2025-12-05 00:17:40 +01:00
Jacob Jonsson
47259d1697 feat: solve day4 part 1
We look at each valid (having coordinates inside the grid) neighbor to
a cell including a paper roll and then see if the neighbor contains a
roll of paper or not. Finally we count the number of rolls, if it is
less than 4 we can pick it.
2025-12-04 23:21:42 +01:00
Jacob Jonsson
19194b5d78 feat: solve part 2 day 3 2025-12-03 23:07:54 +01:00
Jacob Jonsson
249365968a feat: implement day 3, part 1
The solution I went with is to walk the entire bank of batteries with
their joltages and pair them up. At every step I can either form an
incomplete candidate (Left x), or a complete candidate (Right (a, b))
if I already have a previous candidate.
2025-12-03 22:09:09 +01:00
Jacob Jonsson
3f0d19a5d1 feat: solve part 2 of day 2 2025-12-02 15:49:25 +01:00
2e8920cae1
feat: solve day2 part1 2025-12-02 08:31:24 +01:00
12d392e578
feat: solve day1 2025-12-02 08:01:56 +01:00
fd14a98915
chore: add scaffolding 2025-12-02 08:01:11 +01:00