Project Euler is a website dedicated to a series of computational problems intended to be solved with computer programs. Each problem has been designed according to a one-minute rule, which means that although it may take several hours to design a successful algorithm with more difficult problems, an efficient implementation will allow a solution to be obtained on a modestly powered computer in less than one minute. In this presentation I will share what I have learned working on Project Euler in Python.
The first problem is to calculate the sum of multiples of 3 and 5 that are less than or equal to 1000. I first solved the problem with Brute force search. However, when I measured this code on the HackerRank site, it showed that there was a speed problem. To get a more efficient solution you could also calculate the sum of the numbers less than1000 that are divisible by 3, plus the sum of the numbers less than 1000 that are divisible by 5. But as you have summed numbers divisible by 15 twice you would have to subtract the sum of the numbers divisible by 15.