Solution for first 50 problems of project euler