Solution 10

Takes 42 seconds to run,  intend to speed up