Skip to content

Commit

Permalink
dec 25 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
elwaxoro committed Dec 25, 2024
1 parent 1de87a7 commit 5aff78a
Show file tree
Hide file tree
Showing 2 changed files with 4,013 additions and 0 deletions.
14 changes: 14 additions & 0 deletions advent/src/test/kotlin/org/elwaxoro/advent/y2024/Dec25.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.elwaxoro.advent.y2024

import org.elwaxoro.advent.Coord
import org.elwaxoro.advent.PuzzleDayTester

/**
* Day 25: Code Chronicle
*/
class Dec25 : PuzzleDayTester(25, 2024) {

override fun part1(): Any = loader().let { parts -> parts.sumOf { a -> parts.filter { b -> a.none { b.contains(it) } }.size } / 2 }

private fun loader() = load(delimiter = "\n\n").let { l -> l.map { a -> a.split("\n").flatMapIndexed { y, s -> s.mapIndexedNotNull { x, c -> Coord(x, y).takeIf { c == '#' } } } } }
}
Loading

0 comments on commit 5aff78a

Please sign in to comment.