diff --git a/src/main/java/com/adventofcode/flashk/day25/Key.java b/src/main/java/com/adventofcode/flashk/day25/Key.java index bd7c705..1807b49 100644 --- a/src/main/java/com/adventofcode/flashk/day25/Key.java +++ b/src/main/java/com/adventofcode/flashk/day25/Key.java @@ -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; } } diff --git a/src/main/java/com/adventofcode/flashk/day25/Lock.java b/src/main/java/com/adventofcode/flashk/day25/Lock.java index 73e1d6f..5a54038 100644 --- a/src/main/java/com/adventofcode/flashk/day25/Lock.java +++ b/src/main/java/com/adventofcode/flashk/day25/Lock.java @@ -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; } }