Package net.n1da.dev.euler
Class PE0011
- java.lang.Object
-
- net.n1da.dev.euler.core.Problem
-
- net.n1da.dev.euler.PE0011
-
- All Implemented Interfaces:
Solvable
public class PE0011 extends Problem
Solution for problem 11 "Largest product in a grid" completed on Mon, 20 Apr 2015, 12:17.- Since:
- 19.04.2015 06:39:09
- Author:
- Nico Danneberg
- See Also:
- Problem @ Project Euler, Solution @ Ni-Da-Net
-
-
Method Summary
-
Methods inherited from class net.n1da.dev.euler.core.Problem
finish, getResult, getRuntime, toString
-
-
-
-
Field Detail
-
grid
private Matrix grid
The storage for the complete grid.
-
-
Method Detail
-
prepare
public void prepare()
Reads thegrid
data from a file.- Specified by:
prepare
in interfaceSolvable
- Overrides:
prepare
in classProblem
- See Also:
Matrix.load(String, int)
-
solve
public java.lang.String solve()
Solves this problem by dividing the grid into sections of 4x4 cells. for every of this section the maximum product (in all directions) is calculated.- Returns:
- the maximum product of one of the sections
- See Also:
Matrix
,Matrix.findMaxProduct(boolean)
,Matrix.getSection(int, int, int)
-
-