Source: Day 19: Aplenty
Full solution for today (spoilers!)
Part 1
You are given a series of parts with 4 ratings as such:
{x=787,m=2655,a=1222,s=2876}In addition, you are given a series of rules describing a graph as such:
px{a<2006:qkq,m>2090:A,rfg}In this example, if you are at the node
px, ifa < 2006, move toqkq. Otherwise, ifm > 2090move toA. If no other case matches, the last defaults torfg.
AandRare special cases for accept and reject.Calculate the sum of sum of all four ratings for all nodes that end at
Accept.