Advent of Code 2023 day 12
12/12/2024, 5:00 AMMichael de Kaste
12/12/2024, 6:31 AMnkiesel
12/12/2024, 6:48 AMJakub Gwóźdź
12/12/2024, 6:56 AMJonathan Kolberg
12/12/2024, 7:18 AMbj0
12/12/2024, 7:22 AMbj0
12/12/2024, 7:23 AMJonathan Kolberg
12/12/2024, 7:31 AMDan Fingal-Surma
12/12/2024, 8:13 AMDan Fingal-Surma
12/12/2024, 8:14 AMDan Fingal-Surma
12/12/2024, 8:14 AMJonathan Kolberg
12/12/2024, 8:15 AMDan Fingal-Surma
12/12/2024, 8:15 AMJakub Gwóźdź
12/12/2024, 8:15 AMDan Fingal-Surma
12/12/2024, 8:15 AMDan Fingal-Surma
12/12/2024, 8:17 AMJakub Gwóźdź
12/12/2024, 8:18 AMDan Fingal-Surma
12/12/2024, 8:18 AMDan Fingal-Surma
12/12/2024, 8:25 AMDan Fingal-Surma
12/12/2024, 8:30 AMDan Fingal-Surma
12/12/2024, 8:31 AMDan Fingal-Surma
12/12/2024, 8:42 AMLuan Tran
12/12/2024, 9:26 AMphldavies
12/12/2024, 9:32 AMWarming up 1 puzzles over 5s for year 2024 day 12...
Warmup finished after 5.013797500s with 182 iterations
year 2024 day 12 part 1
Default took 12.277708ms 👑: 1381056
year 2024 day 12 part 2
Default took 13.564ms 👑: 834828
Luan Tran
12/12/2024, 10:14 AMvar lineCount = 0
lineCount += horizontalLines.sumOf { line ->
2 - horizontalLines.count { other ->
other.first().x - line.first().x in listOf(-1, 1)
&& other.first().y <= line.first().y && other.last().y >= line.last().y
}
+ horizontalLines.count { other ->
other.first().x - line.first().x in listOf(-1, 1)
&& other.first().y < line.first().y && other.last().y > line.last().y
}
}
while this one work normally
var lineCount = 0
lineCount += horizontalLines.sumOf { line ->
val merge = horizontalLines.count { other ->
other.first().x - line.first().x in listOf(-1, 1)
&& other.first().y <= line.first().y && other.last().y >= line.last().y
}
val split = horizontalLines.count { other ->
other.first().x - line.first().x in listOf(-1, 1)
&& other.first().y < line.first().y && other.last().y > line.last().y
}
2 - merge + split
}
Luan Tran
12/12/2024, 10:17 AMMax Thiele
12/12/2024, 10:18 AMLuan Tran
12/12/2024, 10:20 AMkingsley
12/12/2024, 12:24 PMLuan Tran
12/12/2024, 12:34 PMephemient
12/12/2024, 2:28 PMephemient
12/12/2024, 2:31 PM.trimIndent()
instead of .trimMargin()
in one placeephemient
12/12/2024, 2:36 PMephemient
12/12/2024, 2:38 PMephemient
12/12/2024, 2:40 PMNeil Banman
12/12/2024, 6:37 PMphldavies
12/12/2024, 7:07 PMWarming up 2 puzzles for 10s each for year 2024 day 12...
Default warmed up with 1014 iterations
FenceWalker warmed up with 1136 iterations
year 2024 day 12 part 1
FenceWalker took 3.768015ms 👑: 1381056
Default took 3.777930ms (1.00x): 1381056
year 2024 day 12 part 2
FenceWalker took 4.885262ms 👑: 834828
Default took 5.412263ms (1.11x): 834828
about as fast as I can (be bothered) to get itphldavies
12/12/2024, 7:08 PMdo statement while()
without braces surprised mebj0
12/12/2024, 7:11 PMphldavies
12/12/2024, 7:41 PMbj0
12/12/2024, 7:41 PMphldavies
12/12/2024, 7:42 PMbj0
12/12/2024, 7:44 PMbj0
12/12/2024, 7:45 PMReece H. Dunn
12/12/2024, 9:27 PMReece H. Dunn
12/12/2024, 9:28 PMtodd.ginsberg
12/12/2024, 10:01 PMDan Fingal-Surma
12/12/2024, 10:07 PMPaul Woitaschek
12/12/2024, 10:10 PMJosh Soberg
12/12/2024, 10:16 PMNeil Banman
12/12/2024, 10:18 PMJosh Soberg
12/12/2024, 10:19 PMPaul Woitaschek
12/12/2024, 10:19 PMPaul Woitaschek
12/12/2024, 10:20 PMDan Fingal-Surma
12/12/2024, 10:28 PMDan Fingal-Surma
12/12/2024, 10:30 PM202
0 2
22
Josh Soberg
12/12/2024, 10:35 PMDan Fingal-Surma
12/12/2024, 10:36 PMXXX
XXX
XX
The inner corner gets assigned to (1,1) even though it is not on the perimeter per seDan Fingal-Surma
12/12/2024, 10:37 PMDan Fingal-Surma
12/12/2024, 10:45 PMDan Fingal-Surma
12/12/2024, 10:52 PMDan Fingal-Surma
12/12/2024, 10:54 PMReece H. Dunn
12/12/2024, 11:04 PMNeil Banman
12/12/2024, 11:11 PMJakub Gwóźdź
12/13/2024, 11:26 AMphldavies
12/13/2024, 11:50 AM