Project Euler Solutions Hackerrank Java