master: Found a way to shave another 100 or so bytes off golfed solution, by aggressively combining statements into functions and reducing distinct calls to Set methods.
master: removed a premature optimization to shave another few bytes off.
master: Shaved off a few more bytes by cleverly reducing new instances of sets.