Package net.n1da.dev.euler
Class PE0053
- java.lang.Object
-
- net.n1da.dev.euler.core.Problem
-
- net.n1da.dev.euler.PE0053
-
- All Implemented Interfaces:
Solvable
public class PE0053 extends Problem
Solution for problem 53 "Combinatoric selections" completed on Tue, 16 Aug 2016, 17:43.- Since:
- 14.08.2016 20:28:56
- Author:
- Nico Danneberg
- See Also:
- Problem @ Project Euler, Solution @ Ni-Da-Net
-
-
Method Summary
Modifier and Type Method Description private long
combi(int n, int r)
Calculates the number of combinations that are possible by selecting r elements out of a n-size set of elements.java.lang.String
solve()
Tries to find the smallest r from both sides, 1 to n and n to 1, that leads to a combination greater than one million. n runs from one to one-hundred itself.
-
-
-
Method Detail
-
solve
public java.lang.String solve()
Tries to find the smallest r from both sides, 1 to n and n to 1, that leads to a combination greater than one million. n runs from one to one-hundred itself.- Returns:
- the number of combinations that leads to more than one million
-
combi
private long combi(int n, int r)
Calculates the number of combinations that are possible by selecting r elements out of a n-size set of elements.- Parameters:
n
- the number of elementsr
- the size of the subset of elements- Returns:
- the number of combinations
-
-