JP's Blog

  • GitHub * Flickr * Resume
  • Reviews
  • Programming
  • Home Automation
  • Photography
  • Maker
  • Writing
  • Research
  • Search
  • RSS

AoC 2024 Day 10: Take-a-Hikinator

2024-12-10

Source: Day 10: Hoof It

Full solution for today (spoilers!).

  • Source: Day 10: Hoof It
  • Part 1
    • Optimization 1: Using dynamic programming
    • Optimization 2: Smarter bitmasks
  • Part 2
  • Benchmarks

Part 1

Given a heightmap (0 to 9), for each 0 count how many 9 you can reach on paths that only ever increase height by exactly 1 at a time. Sum these values.

read more...


AoC 2024 Day 7: Mathinator

2024-12-07

Source: Day 7: Bridge Repair

Full solution for today (spoilers!).

  • Source: Day 7: Bridge Repair
  • Part 1
    • Optimization (attempt) 1: Queue
  • Part 2
  • A ‘cleaner’ way of looking at it: OpSet
  • Benchmarks
  • Future work

Part 1

Given a result and a list of numbers, determine if any combination of addition (+) and/or multiplication (*) using all the given numbers in order can return the result. Ignore order of operations.

read more...

  • All posts: By Date
  • All posts: By Tag
  • RSS: All
  • RSS: programming/topics

All posts unless otherwise mentioned are licensed under Creative Commons License

Any source code unless otherwise mentioned is licensed under the 3 clause BSD license