This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aoc2022 | |
object Day04: | |
private type InputType = Seq[String] | |
@main def runDay04(): Unit = | |
solve(testInput, input, ready, part1, part2) | |
private def ready(input: String): InputType = | |
input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aoc2022 | |
object Day03: | |
private type InputType = Seq[String] | |
@main def runDay03(): Unit = | |
solve(testInput, input, ready, part1, part2) | |
private def ready(input: String): InputType = | |
input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aoc2022 | |
object Day02: | |
private type InputType = Seq[Seq[String]] | |
@main def runDay02: Unit = | |
val testData = time("testReady", () => ready(testInput)) | |
time("testPart1", () => part1(testData)) // should be 15 | |
time("testPart2", () => part2(testData)) // should be 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aoc2021 | |
import scala.annotation.tailrec | |
import scala.collection.mutable | |
object Day15: | |
type InputType = Seq[Seq[Int]] | |
@main def runDay15: Unit = | |
val testData = time("testReady", () => ready(testInput)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aoc2021 | |
import java.util | |
import scala.annotation.tailrec | |
import scala.collection.mutable | |
object Day14: | |
type InputType = (Seq[Char], Instruction) | |
type Instruction = Map[(Char, Char), Char] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aoc2021 | |
import scala.annotation.tailrec | |
object Day13: | |
type InputType = (Set[Dot], Seq[Fold]) | |
case class Dot(x: Int, y: Int) | |
case class Fold(dir: FoldDir, pos: Int) | |
enum FoldDir: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aoc2021 | |
import scala.:: | |
import scala.annotation.tailrec | |
import scala.collection.mutable | |
object Day09: | |
type InputType = Seq[Seq[Int]] | |
@main def runDay09: Unit = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aoc2021 | |
object Day08: | |
type InputType = Seq[Display] | |
/** | |
* 0 6 | |
* 1 2 * | |
* 2 5 | |
* 3 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aoc2021 | |
object Day07: | |
type InputType = Seq[Int] | |
@main def runDay07(): Unit = | |
val testData = time("testReady", () => ready(testInput)) | |
time("testPart1", () => part1(testData)) // should be 37 | |
time("testPart2", () => part2(testData)) // should be 168 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aoc2021 | |
object Day06: | |
type InputType = Seq[Int] | |
@main def runDay06(): Unit = | |
val testData = time("testReady", () => ready(testInput)) | |
time("testPart1", () => part1(testData)) // should be 5934 | |
time("testPart2", () => part2(testData)) // should be 26984457539 |
NewerOlder