Package net.n1da.dev.euler
Class PE0031
- java.lang.Object
-
- net.n1da.dev.euler.core.Problem
-
- net.n1da.dev.euler.PE0031
-
- All Implemented Interfaces:
Solvable
public class PE0031 extends Problem
Solution for problem 31 "Coin sums" completed on Sat, 19 Dec 2015, 22:30.- Since:
- 12.12.2015 00:23:18
- Author:
- Nico Danneberg
- See Also:
- Problem @ Project Euler, Solution @ Ni-Da-Net
-
-
Method Summary
Modifier and Type Method Description private void
check(int level)
Here the algorithm is implemented by checking every combination of coins.private int
getSum()
Calculates the sum of the combination inused
array.void
prepare()
java.lang.String
solve()
This problem is solved by a recursive call of thecheck(int)
method.-
Methods inherited from class net.n1da.dev.euler.core.Problem
finish, getResult, getRuntime, toString
-
-
-
-
Method Detail
-
prepare
public void prepare()
-
solve
public java.lang.String solve()
This problem is solved by a recursive call of thecheck(int)
method. Here this method is called and the finalcount
is returned.- Returns:
- the count of all found combinations
-
check
private void check(int level)
Here the algorithm is implemented by checking every combination of coins. If thesum
of the current combination is less than 200 this method is called recursively for the next smaller coin.- Parameters:
level
- the position incoins
array
-
-