Skip to content

Commit 5a24500

Browse files
committed
refactor: clean day 4 code
1 parent dd4a423 commit 5a24500

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/main/java/com/adventofcode/flashk/day04/CeresSearch.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
package com.adventofcode.flashk.day04;
22

3-
import com.adventofcode.flashk.common.Array2DUtil;
43
import com.adventofcode.flashk.common.Vector2;
5-
import org.apache.commons.lang3.StringUtils;
64

75
import java.util.ArrayList;
86
import java.util.List;
97

108
public class CeresSearch {
119

12-
private static final String XMAS = "XMAS";
13-
private static final String SAMX = "SAMX";
14-
private static final String MAS = "MAS";
1510
private static final char X = 'X';
1611
private static final char M = 'M';
1712
private static final char A = 'A';
@@ -48,7 +43,7 @@ public long solveB() {
4843
}
4944

5045
private int find(Vector2 xPos) {
51-
char[] word = MAS.toCharArray();
46+
char[] word = { M, A, S };
5247

5348
int totalCount = find(word, 0, xPos, new Vector2(-1,-1));
5449
totalCount += find(word, 0, xPos, new Vector2(-1,1));

0 commit comments

Comments
 (0)