diff --git a/src/aoc2024/Day09.kt b/src/aoc2024/Day09.kt index d3c6a38..40d1858 100644 --- a/src/aoc2024/Day09.kt +++ b/src/aoc2024/Day09.kt @@ -48,14 +48,12 @@ fun main() { fun part2(input: List): Long { var pos = 0 var isFile = true - var fileId = 0 val freeList = Array>(10) { TreeSet() } val fileList = ArrayList>((input[0].length + 1) / 2) for (c in input[0]) { val size = c - '0' if (isFile) { fileList.add(pos to size) - fileId++ } else if (size > 0) { freeList[size].add(pos) }