Advent of Code 2022 - Day 7

This one was a little more challenging until I remembered to use :digraph to make life easier. Not totally happy with my parsing that required the full path as a node key, but I couldn’t think of another way to keep /a/e from being overwritten by a possible /b/e path. Also not super happy about having to walk the graph to update the sizes with the sub-directory sizes but it ended up being efficient enough for this exercise. Also a couple lines of duplication between part1 and part2 that I could have turned into one helper function, but LOC would actually increase so I didn’t think it was worth it.

https://github.com/stevensonmt/advent_of_code/blob/2022/2022/day7/lib/day7.ex

Very crude benchmarking, but with :timer.tc parsing and solving part 1 was 3192 usec, part 2 was 3321 usec.