diff --git a/src/main/kotlin/AdventOfCode2023/day4/Scratchcards.kt b/src/main/kotlin/AdventOfCode2023/day4/Scratchcards.kt index 6786fa7..8bad7d1 100644 --- a/src/main/kotlin/AdventOfCode2023/day4/Scratchcards.kt +++ b/src/main/kotlin/AdventOfCode2023/day4/Scratchcards.kt @@ -46,6 +46,6 @@ class Scratchcards : Puzzle("2023", "4") { val parts = card.split("|") val cleanParts = parts[1].split(Regex("\\s")).filter { it != "" }.toSet() val winningNumbers = parts[0].split(":")[1].split(Regex("\\s")).filter { it != "" }.toSet() - return winningNumbers.filter { number -> cleanParts.contains(number) }.count() + return winningNumbers.count { number -> cleanParts.contains(number) } } } \ No newline at end of file