Commit Graph
54 Commits
Author SHA1 Message Date
ktims 02fc154547 grid: use coord2d more consistently 2024-12-21 21:01:16 -08:00
ktims 13f61e3a2b part2: works up to the 4th iteration, then returns too high values
I think the issue is not testing both possible paths for direction keypads, but doing this naively blows up the compute complexity (and I got the wrong answer)
2024-12-21 02:48:39 -08:00
ktims 8958ba9361 day21: part 1 solution 2024-12-20 23:20:21 -08:00
ktims e60f6effa3 day20: part 1 solution 2024-12-20 20:56:14 -08:00
ktims c2e3422544 day19: rayon - ez mode parallelization, speed * 6 2024-12-18 23:09:51 -08:00
ktims 6b6dededc2 day19: clippies 2024-12-18 22:45:10 -08:00
ktims 65d498f168 day19: complete solution 2024-12-18 22:39:32 -08:00
ktims cdb3a7261a day19: pre puzzle boilerplate 2024-12-18 20:56:36 -08:00
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 3712b32634 grid: row and column iterators 2024-12-18 15:31:07 -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
ktims 9be86e2cc2 day17: clippies 2024-12-17 01:03:06 -08:00
ktims 5bcead2691 day17: part 2 solution 2024-12-17 00:46:18 -08:00
ktims c99d8a400a day17: part 1 solution 2024-12-16 22:29:55 -08:00
ktims 5e8b974137 clippies! 2024-12-16 14:54:48 -08:00
ktims 28a88e1aa7 day14: replace RE parser with nom consuming parser
Almost 100x speedup on parsing phase avoiding RE compile, saves ~60ms
2024-12-16 14:47:48 -08:00
ktims de7ee8f0f6 day14: don't print robots map 2024-12-16 11:40:10 -08:00
ktims c31d653612 day16: minor performance and refactoring 2024-12-16 01:33:02 -08:00
ktims 20e6889572 day16: improve perf again by going to i16 positions
map dimensions fit in i16, so use those in data structures

make grid support generic position type as long as they implement to i64
2024-12-16 01:06:39 -08:00
ktims 755fbbc53d day16: refactor, optimize
split path recording and best cost functions for big gainz

use i32 instead of i64 positions to shrink data structures for some
gainz
2024-12-16 00:58:15 -08:00
ktims 4b85a90635 day16: part 2 solution 2024-12-15 23:22:14 -08:00
ktims 6283ff37f9 day16: part 1 solution 2024-12-15 22:06:21 -08:00
ktims c261ee56fe day15: cleanup, clippies 2024-12-15 01:03:08 -08:00
ktims 411d6aa26d day15: cleanup & use the same implementation for both parts 2024-12-15 00:56:07 -08:00
ktims c2c0145219 day15: part 2 submitted solution 2024-12-15 00:50:19 -08:00
ktims 4dfdaca58c day15: part 1 solution + beginning of part 2 2024-12-15 00:49:44 -08:00
ktims b060de20c7 day11: clippies 2024-12-13 23:44:46 -08:00
ktims 74a6b16924 chore: rust fmt 2024-12-13 23:06:07 -08:00
ktims e8a38e7b24 day14: pretty print a tree 2024-12-13 23:05:58 -08:00
ktims c6153663b5 day14: complete solution 2024-12-13 22:53:07 -08:00
ktims d88f907c03 clippies 2024-12-13 17:55:28 -08:00
ktims ed184fc92c day12/day13: codspeed compat (&str input) 2024-12-13 17:42:44 -08:00
ktims 1a6d37f4f3 clippies 2024-12-13 02:17:57 -08:00
ktims ebf5a0a489 day13: complete solution 2024-12-13 02:12:18 -08:00
ktims 4aa7e9f43c day3: perf - branchless 2024-12-12 17:56:28 -08:00
ktims a5439062a4 day3: performance - avoid converting &[u8] to &str 2024-12-12 17:38:42 -08:00
ktims 3658183deb day7: performance. DFS with pruning. 2024-12-12 16:02:13 -08:00
ktims 38cba37b06 day5: perf: switch to sort-based implementation 2024-12-12 14:50:00 -08:00
ktims 6022d2cc39 multiple: Use FxHashMap for s p e e d 2024-12-12 14:07:22 -08:00
ktims 447ff5c62c grid: improve ergonomics with more trait impls and other improvements
update puzzles to pass tests, some performance gains
2024-12-12 02:14:29 -08:00
ktims c213bbbc27 day12: optimization and cleanup 2024-12-12 01:24:14 -08:00
ktims a56fc933c9 day12: complete solution 2024-12-11 22:27:59 -08:00
ktims 31eb500832 day7: slight performance improvement from skipping ThreadLoacls 2024-12-11 19:40:45 -08:00
ktims 4c14c6092e bugfix: count off by one, thought ^ was left in the map, but it gets
replaced by X
2024-12-11 18:59:58 -08:00