// Illustration of an algorithm. public class NaiveBoxAlgorithm implements BoxProblemAlgorithm { int width=-1, height=-1; public String getName () { return "Naive"; } public BoxSolution findSolution (BoxProblem problem) { // Start by creating an instance of the solution class. BoxSolution solution = new BoxSolution (); // Key idea: Go left to right assigning along the bottom. int currentRight = 0; for (int i=0; i width) { width = c.x; } if (c.y > height) { height = c.y; } } // Add 1 to get the actual length width ++; height ++; } }