Advent of Code 2020: Day 14 (Ruby solution)