Advent of Code 2020: Day 15 (Ruby solution)