Skip to content

Commit

Permalink
feat: minor adjustments to day 25
Browse files Browse the repository at this point in the history
  • Loading branch information
Flashky committed Dec 25, 2024
1 parent 899da33 commit 3a1dac0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/adventofcode/flashk/day25/Key.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
public class Key {

@Getter
private int[] heights = new int[5];
private final int[] heights = new int[5];

public Key(char[][] keyMap) {
char[][] trasposedMap = Array2DUtil.transpose(keyMap);
char[][] transposedMap = Array2DUtil.transpose(keyMap);

for(int i = 0; i < trasposedMap.length; i++) {
String rowValue = new String(trasposedMap[i]);
for(int i = 0; i < transposedMap.length; i++) {
String rowValue = new String(transposedMap[i]);
heights[i] = StringUtils.countMatches(rowValue, "#")-1;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/adventofcode/flashk/day25/Lock.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

public class Lock {

private int[] pins = new int[5];
private final int[] pins = new int[5];

public Lock(char[][] lockMap) {

char[][] trasposedMap = Array2DUtil.transpose(lockMap);
char[][] transposedMap = Array2DUtil.transpose(lockMap);

for(int i = 0; i < trasposedMap.length; i++) {
String rowValue = new String(trasposedMap[i]);
for(int i = 0; i < transposedMap.length; i++) {
String rowValue = new String(transposedMap[i]);
pins[i] = StringUtils.countMatches(rowValue, "#")-1;
}
}
Expand Down

0 comments on commit 3a1dac0

Please sign in to comment.