- All Implemented Interfaces:
public class PE0031 extends ProblemSolution for problem 31 "Coin sums" completed on Sat, 19 Dec 2015, 22:30.
- 12.12.2015 00:23:18
- Nico Danneberg
- See Also:
- Problem @ Project Euler, Solution @ Ni-Da-Net
Fields Modifier and Type Field Description
coinsStores for every coin the count to fill 200 pence.
countCounts the number of found combinations.
usedStores for every coin how many are used in a combination.
Modifier and Type Method Description
check(int level)Here the algorithm is implemented by checking every combination of coins.
getSum()Calculates the sum of the combination in
solve()This problem is solved by a recursive call of the
Methods inherited from class net.n1da.dev.euler.core.Problem
finish, getResult, getRuntime, toString
public void prepare()
public java.lang.String solve()This problem is solved by a recursive call of the
check(int)method. Here this method is called and the final
- the count of all found combinations
private void check(int level)Here the algorithm is implemented by checking every combination of coins. If the
sumof the current combination is less than 200 this method is called recursively for the next smaller coin.
level- the position in