Problem 47 solution added. ~0.47 seconds running time.