Terribly inefficient algorithm but at this point I don't care.
Part 2 is failing the example and I have no idea why :(