My solution to Project Euler