Problem 50 Solution, ~52 second Execution Time