π Day 12
In Zig
Very annoying day. I hate combinations, permutations and stuff like that. Its always annoying. This day was apparently "DP" (Dynamic Programming), which im not familiar with at all. I needed to look at a ton of hints to solve it. Rewrote it a bunch of times but at last got it working.
Part 2 was extremely slow and after a while of trying to figure out what to do, i found out that i need to use memoization. In short, its basically storing results of expensive functions and reusing the stored results if the same input is passed again instead of re-calculating it. It seems like quite a reasonable and obvious concept but ive never heard of it until now.
That aside, Zig is just like i remember it from AOC 2022 - pretty nice.
To run part 1 or part 2, do:
$ make part1
$ make part2