jeff,
@jeff@phpc.social avatar

I just completed "Aplenty" - Day 19 - Advent of Code 2023

Part 1 was basically what I do at work every day w/ cascading workflow rules and automation.

I had a good idea of what to do on Part 2 from the start, so it was a lot more enjoyable. I got the runtime for both parts down to ~3ms.

https://github.com/jstanden/advent-of-code-php/blob/main/2023/19-aplenty/solution.php?ts=4

18+ jeff,
@jeff@phpc.social avatar

Once I read Part 2 and saw the example sum of combinations, I knew we'd be dealing with ranges again for hypothetical parts.

I created a HypotheticalPart class with the four (x,m,a,s) ranges of (1-4000) within it.

As I processed workflow rules, I partitioned range remainders into disjoint hypothetical parts.

Otherwise it was pretty standard recursion. Parsing was about half the code today.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php
  • DreamBathrooms
  • magazineikmin
  • everett
  • InstantRegret
  • rosin
  • Youngstown
  • slotface
  • love
  • khanakhh
  • kavyap
  • tacticalgear
  • GTA5RPClips
  • thenastyranch
  • modclub
  • anitta
  • mdbf
  • tester
  • Durango
  • ethstaker
  • osvaldo12
  • cubers
  • ngwrru68w68
  • provamag3
  • normalnudes
  • Leos
  • cisconetworking
  • megavids
  • JUstTest
  • All magazines