Skip to content

Commit afe56fc

Browse files
authored
Update Solution.java
1 parent 16ac93a commit afe56fc

File tree

1 file changed

+0
-5
lines changed
  • src/main/java/g1901_2000/s1931_painting_a_grid_with_three_different_colors

1 file changed

+0
-5
lines changed

src/main/java/g1901_2000/s1931_painting_a_grid_with_three_different_colors/Solution.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,12 @@ public int colorTheGrid(int m, int n) {
2121
if (n == 2) {
2222
return (int) (6L * powMod(3, m - 1) % P);
2323
}
24-
2524
int totalTemplates = 1 << (m - 2);
2625
int totalPaintings = binPow(3, m);
27-
2826
int[] paintingToTemplate = new int[totalPaintings];
2927
long[] paintingCountForTemplate = new long[totalTemplates];
3028
long[][] templateEdgeCount = new long[totalTemplates][totalTemplates];
31-
3229
Map<Integer, Integer> templateToIndex = new HashMap<>(1 << (m - 2));
33-
3430
int templateCounter = 0;
3531
for (int i = 0; i < totalPaintings; i++) {
3632
int type = getType(i, m);
@@ -66,7 +62,6 @@ public int colorTheGrid(int m, int n) {
6662
templateEdgeCount[i][j] /= c;
6763
}
6864
}
69-
7065
long[][] matrixPower = matrixPower(templateEdgeCount, (long) n - 1);
7166
long ans = 0;
7267
for (int i = 0; i < totalTemplates; i++) {

0 commit comments

Comments
 (0)