mirror of
https://github.com/parnic/advent-of-code-2022.git
synced 2025-06-16 13:40:13 -05:00
I spent an inordinately long amount of time on part 2, only to discover a fundamental flaw in my logic. Apparently for my input set, switching to the other person every time the first person had less time remaining meant that some combinations never got tested. The solution in this commit exhausts every option for one person, then every option for the second person (or animal...) which works for my test input. I have a feeling it won't work for all, though.
10 lines
564 B
Plaintext
10 lines
564 B
Plaintext
Valve AA has flow rate=0; tunnels lead to valves DD, II, BB
|
|
Valve BB has flow rate=13; tunnels lead to valves CC, AA
|
|
Valve CC has flow rate=2; tunnels lead to valves DD, BB
|
|
Valve DD has flow rate=20; tunnels lead to valves CC, AA, EE
|
|
Valve EE has flow rate=3; tunnels lead to valves FF, DD
|
|
Valve FF has flow rate=0; tunnels lead to valves EE, GG
|
|
Valve GG has flow rate=0; tunnels lead to valves FF, HH
|
|
Valve HH has flow rate=22; tunnel leads to valve GG
|
|
Valve II has flow rate=0; tunnels lead to valves AA, JJ
|
|
Valve JJ has flow rate=21; tunnel leads to valve II |