-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay20Test.kt
52 lines (45 loc) · 1.27 KB
/
Day20Test.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package io.dmitrijs.aoc2023
import io.dmitrijs.aoc2023.Resources.resourceAsLines
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Tag
import kotlin.test.Test
import kotlin.test.assertEquals
@DisplayName("Day 20")
internal class Day20Test {
@Nested
inner class Example {
@Test
fun puzzle1() {
val exampleInput1 = """
broadcaster -> a, b, c
%a -> b
%b -> c
%c -> inv
&inv -> a
""".trimIndent().lines()
val exampleInput2 = """
broadcaster -> a
%a -> inv, con
&inv -> b
%b -> con
&con -> output
""".trimIndent().lines()
assertEquals(32_000_000, Day20(exampleInput1).puzzle1())
assertEquals(11_687_500, Day20(exampleInput2).puzzle1())
}
}
@Nested
@Tag("personal")
inner class Problem {
private val day = Day20(resourceAsLines("day20"))
@Test
fun puzzle1() {
assertEquals(711_650_489, day.puzzle1())
}
@Test
fun puzzle2() {
assertEquals(219_388_737_656_593, day.puzzle2())
}
}
}