Solved Project Euler Problem2