Package net.n1da.dev.euler
Class PE0001
- java.lang.Object
-
- net.n1da.dev.euler.core.Problem
-
- net.n1da.dev.euler.PE0001
-
- All Implemented Interfaces:
Solvable
public class PE0001 extends Problem
Solution for problem 1 "Multiples of 3 and 5" completed on Tue, 7 Apr 2015, 23:11.- Since:
- 07.04.2015 21:34:41
- Author:
- Nico Danneberg
- See Also:
- Problem @ Project Euler, Solution @ Ni-Da-Net
-
-
Method Detail
-
solve
public java.lang.String solve()
It solves this problem by defining an array of spaces between the multiples of 3 and 5. Since the spaces are periodically after 9 steps the array can be used in a loop. The runtime is reduced by around 55% against the standard loop testing every number to be a multiple!- Returns:
- the wanted sum
-
-