Solved 23 - I want to optimize it

Not proud of my solution.  Takes 11.6s to calculate and that is just
sad.