From 09d89a95625ee4a824e219260f8a846aa4bf9403 Mon Sep 17 00:00:00 2001 From: Denis-Cosmin NUTIU Date: Wed, 6 Dec 2023 12:30:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=84Advent=20of=20Code=20-=20Day=206=20?= =?UTF-8?q?=E2=9C=A8part=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/AdventOfCode2023/day6/WaitForIt.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/AdventOfCode2023/day6/WaitForIt.kt b/src/main/kotlin/AdventOfCode2023/day6/WaitForIt.kt index 25e09c4..6d7e2fc 100644 --- a/src/main/kotlin/AdventOfCode2023/day6/WaitForIt.kt +++ b/src/main/kotlin/AdventOfCode2023/day6/WaitForIt.kt @@ -31,8 +31,7 @@ class WaitForIt : Puzzle("2023", "6") { override fun partTwo() { listOf(Race(49787980, 298118510661181)).map { // here we transform a race into a list of all the possible combinations that we can have - (1.. Race((it.raceTime - time)* time, it.distance) }.collect( - Collectors.toList()) + (1.. Race((it.raceTime - time)* time, it.distance) } }.map { // Here we filter out the losing races it.parallelStream().filter { it.raceTime > it.distance }.count()