Advent of Code 2020: Day 7 (Ruby solution)