diff --git a/days/src/main/kotlin/Day16.kt b/days/src/main/kotlin/Day16.kt index fd7ea7e..ed13e48 100644 --- a/days/src/main/kotlin/Day16.kt +++ b/days/src/main/kotlin/Day16.kt @@ -91,8 +91,7 @@ class Day16(@Groups val input: Input>>) { val one = values.filter { it.size() == 1 } .map { it.first() } - .find { !removed.contains(it) } - ?.also { removed.add(it) } + .find { removed.add(it) } ?: error("No values left to remove") for (entry in indexesByCategory.keyMultiValuePairsView()) {