Add solution to Project Euler #24.
Refactoring.
Refactoring.