Advent of Code - Day 24

Here’s mine, which takes about 7 seconds.