I didn't figure out the rule at all, but I did got the solution (of many?) on the first try, so cool I guess :)- From the Tom Scott newsletter