Problem 47 Solution, ~3.49 second Execution Time