Unused variable.

This commit is contained in:
Chris Hodges 2024-12-10 18:19:32 +01:00
parent bc1888299b
commit 3d17ed29c7

View File

@ -48,14 +48,12 @@ fun main() {
fun part2(input: List<String>): Long {
var pos = 0
var isFile = true
var fileId = 0
val freeList = Array<MutableSet<Int>>(10) { TreeSet() }
val fileList = ArrayList<Pair<Int, Int>>((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)
}