From edce14cd40a70f49915e0a519908b38955dabfb6 Mon Sep 17 00:00:00 2001 From: Hubert Van De Walle Date: Wed, 16 Dec 2020 09:46:49 +0100 Subject: [PATCH] Skip set.contains() --- days/src/main/kotlin/Day16.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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()) {