Skip to content

Commit

Permalink
refactor: minor line adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Flashky committed Dec 9, 2024
1 parent b84ae80 commit 21cf070
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ public class DiskFragmenter {
private final Deque<Integer> diskDeque = new ArrayDeque<>();

public DiskFragmenter(List<String> inputs) {
char[] diskMap = inputs.get(0).toCharArray();

char[] diskMap = inputs.get(0).toCharArray();
int fileId = 0;
int lastBlockIndex = 0;

for(int i = 0; i < diskMap.length; i++) {

int blockSize = Character.getNumericValue(diskMap[i]);

for(int blockIndex = lastBlockIndex; blockIndex < lastBlockIndex + blockSize; blockIndex++) {
Expand Down

0 comments on commit 21cf070

Please sign in to comment.