We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e51f815 commit 16fa1b1Copy full SHA for 16fa1b1
solutions/aockt/y2024/Y2024D04.kt
@@ -37,12 +37,13 @@ object Y2024D04 : Solution {
37
}
38
39
override fun partTwo(input: String): Int = with(parseInput(input)) {
40
+ val mas = setOf("MAS", "SAM")
41
points()
42
.filter { (p, v) -> v == 'A' && p.x in 1..<width - 1 && p.y in 1..<height - 1 }
43
.count { (p, v) ->
44
val mainDiag = "${get(p.move(Left).move(Up))}$v${get(p.move(Right).move(Down))}"
45
val sideDiag = "${get(p.move(Right).move(Up))}$v${get(p.move(Left).move(Down))}"
- with("MAS|SAM") { mainDiag in this && sideDiag in this }
46
+ mainDiag in mas && sideDiag in mas
47
48
49
0 commit comments