Skip to content

Commit 04bce69

Browse files
committed
added reminders
1 parent 084d4a1 commit 04bce69

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/main/java/com/team/hashcode/pizza/Pizza.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,32 @@
33
import java.util.ArrayList;
44
import java.util.List;
55

6+
/**
7+
*
8+
* 1. Save slice only after checking valid slice, I mean :
9+
* - size <= maxCellsPerSlice
10+
* - not cover already defined slices
11+
* - slice contain minEachIngredient per slice
12+
* 2. Mark slice's coordinates in matrixCopy as * in order to avoid covering
13+
* 3. Keep in mind even and odd numbers in slice
14+
*
15+
* */
616
public class Pizza {
717

818
private char[][] matrix;
919
private char[][] matrixCopy;
1020
private int maxCellsPerSlice;
21+
private int minEachIngredient;
1122
final List<Slice> slices = new ArrayList<>();
1223

1324
private int row;
1425
private int columns;
1526

16-
public Pizza(char[][] matrix, int maxCellsPerSlice) {
27+
public Pizza(char[][] matrix, int maxCellsPerSlice, int minEachIngredient) {
1728
this.matrix = matrix;
1829
this.matrixCopy = matrix;
1930
this.maxCellsPerSlice = maxCellsPerSlice;
31+
this.minEachIngredient = minEachIngredient;
2032
this.row = matrix.length;
2133
this.columns = matrix[0].length;
2234
}

src/main/java/com/team/hashcode/pizza/TeamPizza.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static void main(String[] args) throws Exception {
2020
strings = strings.subList(1, strings.size());
2121
char[][] matrix = createMatrix(strings);
2222

23-
Pizza pizza = new Pizza(matrix, maxCellsPerSlice);
23+
Pizza pizza = new Pizza(matrix, maxCellsPerSlice, minEachIngredient);
2424
pizza.cutPizza();
2525
List<Slice> slices = pizza.getSlices();
2626

0 commit comments

Comments
 (0)