Commit Graph
8 Commits
Author SHA1 Message Date
ktims dbee7d91b6 day18: clippies 2024-12-18 15:42:23 -08:00
ktims a1dceb6ff1 day18: perf: swap dijkstra for bfs for ~30% improvement 2024-12-18 15:31:12 -08:00
ktims 2a11e17d92 day18: improve brute for for binary search for big gainz
also avoid unnecessary path tracking work
2024-12-18 11:35:22 -08:00
ktims b588837624 day18: small optimization - avoid duplicates
not sure if the input contains dupes, but avoid doing a second path
search if the square already contains a byte, seems like a small
performance gain
2024-12-18 00:41:28 -08:00
ktims 2729799fa2 day18: optimize
* Implement generic path tracing, so part 1 doesn't store and return the full path,
  just the count.
* Improve part2 impl to only run path search if the block fell on our
  last path.
* Start part2 path search from the best path position immediately before
  the placed block.
2024-12-17 23:51:09 -08:00
ktims 4f48d839b2 day18: part 2 solution + some optimizations 2024-12-17 22:13:49 -08:00
ktims 414569537e day18: part 2 solution 2024-12-17 22:00:10 -08:00
ktims 5036866663 day18: part 1 solution 2024-12-17 21:52:41 -08:00