File tree Expand file tree Collapse file tree
kotlin/adventofcode/year2025
resources/inputs/year2025
kotlin/adventofcode/year2025
resources/inputs/year2025 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929| 2022 | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | | | | | | | | ☆ | | | | ☆ | 28 |
3030| 2023 | ★ | ★ | ★ | ★ | ☆ | ★ | ☆ | | | | | | | | | | | | | | | | | | | 12 |
3131| 2024 | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | | ☆ | ★ | ★ | ★ | ★ | | ★ | | | ☆ | 40 |
32- | 2025 | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | | | | – | – | – | – | – | – | – | – | – | – | – | – | – | 18 |
32+ | 2025 | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | ★ | | ☆ | | – | – | – | – | – | – | – | – | – | – | – | – | – | 19 |
3333
3434## 🛷 How to run
3535
@@ -215,6 +215,7 @@ e.g. `HandyHaversacks`)*
215215| | 7 | [ Laboratories] ( https://adventofcode.com/2025/day/7 ) | [[ Code] ( src/main/kotlin/adventofcode/year2025/Day07Laboratories.kt )]   ; [[ Test] ( src/test/kotlin/adventofcode/year2025/Day07LaboratoriesSpec.kt )] | ` 1711 ` | ` 36706966158365 ` |
216216| | 8 | [ Playground] ( https://adventofcode.com/2025/day/8 ) | [[ Code] ( src/main/kotlin/adventofcode/year2025/Day08Playground.kt )]   ; [[ Test] ( src/test/kotlin/adventofcode/year2025/Day08PlaygroundSpec.kt )] | ` 135169 ` | ` 302133440 ` |
217217| | 9 | [ Movie Theater] ( https://adventofcode.com/2025/day/9 ) | [[ Code] ( src/main/kotlin/adventofcode/year2025/Day09MovieTheater.kt )]   ; [[ Test] ( src/test/kotlin/adventofcode/year2025/Day09MovieTheaterSpec.kt )] | ` 4777409595 ` | ` 1473551379 ` |
218+ | | 11 | [ Reactor] ( https://adventofcode.com/2025/day/11 ) | [[ Code] ( src/main/kotlin/adventofcode/year2025/Day11Reactor.kt )]   ; [[ Test] ( src/test/kotlin/adventofcode/year2025/Day11ReactorSpec.kt )] | ` 699 ` | |
218219
219220## 🕯️ Useful commands
220221
Original file line number Diff line number Diff line change 1+ package adventofcode.year2025
2+
3+ import adventofcode.Puzzle
4+ import adventofcode.PuzzleInput
5+
6+ class Day11Reactor (
7+ customInput : PuzzleInput ? = null ,
8+ ) : Puzzle(customInput) {
9+ private fun parseInput () =
10+ input
11+ .lines()
12+ .map { line -> line.split(" : " , limit = 2 ) }
13+ .associate { (fromDevice, toDevices) -> Pair (fromDevice, toDevices.split(" " ).toSet()) }
14+
15+ override fun partOne () = parseInput().countPaths(START )
16+
17+ companion object {
18+ private const val START = " you"
19+ private const val END = " out"
20+
21+ private fun Map <String , Set <String >>.countPaths (device : String ): Long =
22+ when (device) {
23+ END -> 1
24+ else -> this .getValue(device).sumOf { next -> countPaths(next) }
25+ }
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments