Solve problem 62 using Java.
Improve performance of Go's problem 52.