Problem 24 solution added. ~0.8 seconds running time.