Project Euler 155 - Counting Capacitor Circuits

Official link: https://projecteuler.net/problem=155

Note: My code takes ~550 seconds to run ~76 with pypy, but I'm happy with my solution method.