We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b84ae80 commit 21cf070Copy full SHA for 21cf070
src/main/java/com/adventofcode/flashk/day09/DiskFragmenter.java
@@ -9,11 +9,13 @@ public class DiskFragmenter {
9
private final Deque<Integer> diskDeque = new ArrayDeque<>();
10
11
public DiskFragmenter(List<String> inputs) {
12
- char[] diskMap = inputs.get(0).toCharArray();
13
+ char[] diskMap = inputs.get(0).toCharArray();
14
int fileId = 0;
15
int lastBlockIndex = 0;
16
+
17
for(int i = 0; i < diskMap.length; i++) {
18
19
int blockSize = Character.getNumericValue(diskMap[i]);
20
21
for(int blockIndex = lastBlockIndex; blockIndex < lastBlockIndex + blockSize; blockIndex++) {
0 commit comments