Project Euler Hackerrank Solution