My Code for Project Euler Problem