Commit Graph

19 Commits

Author SHA1 Message Date
9351f26156 day 18 done, day 16 and 17 unfinished
day 18 is simple as the search space is small so for part 2 we can just
do the opposite of part 1 and scan through all empty spaces surrounding
the droplet
Merge branch 'master' of github.com:peter-tanner/advent-of-code-2022
2022-12-18 14:47:16 +08:00
d71d1b14be day 18 done, day 16 and 17 unfinished
day 18 is simple as the search space is small so for part 2 we can just
do the opposite of part 1 and scan through all empty spaces surrounding
the droplet
2022-12-18 14:45:59 +08:00
98eeb321d1 day 15
got both answers first try!
slow af solution. I hoped that keeping the solution O(j) would be quick
enough and seems like it is, takes around ~10 seconds to complete but
that is achievable. For each j it breaks the row into intervals
generated based on the taxicab radius. The intervals are simplified
by sorting and joining.
2022-12-15 17:51:52 +08:00
2ae5cce33d day 14
this is the part where the challenges start to get hard. implementing
the naive solution for part 1 did not take much time. used a hashset
since it's easier than using arrays, but slightly less performant. I
expected the naive solution would not work for part 2 due to the size of
the problem but it still worked, although it did take a few seconds to
finish. the solution i would have used if part 2 took too long would be
to trace some 45* rays from the end points of horizontal beams and
subtract the area inside from the largest sand triangle.
2022-12-14 23:37:58 +08:00
1e4645e835 day 14 (python, lazy) (merge)
starting to learn that recursive data structures are hard in rust...
Merge branch 'master' of github.com:peter-tanner/advent-of-code-2022
2022-12-14 01:00:29 +08:00
eab082f18b day 14 (python, lazy)
starting to learn that recursive data structures are hard in rust...
2022-12-14 00:58:50 +08:00
4d9b65585f day 12
had a lot of issues with this one. I understood i needed dijkstra's from
the start because the second part would probably increase the complexity,
but I did not read the question enough and did not realize that we could
go down by any amount, only increases in elevation were limited. This
resulted in a lot of time being wasted on debug code to print the grid.
2022-12-13 03:37:48 +08:00
357dc93473 day 11
Cool puzzle requiring a bit of thinking for the second part. Had a lot
of issues with rust's moving system in this one, had to read some docs
again. I think I understand it better after this one.
2022-12-11 20:19:58 +08:00
e046630404 day 10
Simple challenge for today. Misread the instructions a few times but
implementing it wasn't too bad.
2022-12-10 15:42:24 +08:00
dd3ec11462 day 9
i learnt more about how memory safety in rust works and why we need to
split a vector when mutating it in two locations to ensure they don't
conflict. makes a lot of sense to me now. also learnt that tuples can be
used in `match`, makes stuff really clean.
2022-12-10 02:06:38 +08:00
bb88b5b7ec day 8
some messing around with isize and usize. also used a brute-force
solution since the input space is small enough.
2022-12-09 00:48:36 +08:00
259a0d7d2f day 7 Was feeling lazy today and did it in python 💀
Have to learn how the various pointer types work for rust, this was the
main blocker preventing me from creating a recursive data structure to
store the tree.
2022-12-08 01:46:06 +08:00
f54f65ca69 day 6
Quick challenge today, just from the input alone it is easy to conclude
the naive solution will work fine even with a large windowing size.
2022-12-06 23:11:05 +08:00
eb541ec0ae day 5
better understood how to use the map function
2022-12-05 16:05:40 +08:00
9449ad8f5c day 4 solutions
learnt how rust does macros.
2022-12-04 17:34:29 +08:00
b907c3d2f4 day 3 2022-12-03 16:50:00 +08:00
38ab90bcec day 2 solution
janky and not expandable but it works
2022-12-03 01:32:50 +08:00
a6894ee3be day 1 part 1 & 2 2022-12-01 14:53:14 +08:00
4e7b2ce48b Initial commit 2022-11-29 17:26:17 +08:00