Using a hash map of hash maps would have made these solutions cleaner
and probably more efficient as well, but I wanted to do some bit
wrangling and I liked the idea of storing the rules in a single integer.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>