Skip to content

Instantly share code, notes, and snippets.

View n3o59hf's full-sized avatar

Elviss Kustans n3o59hf

View GitHub Profile
@n3o59hf
n3o59hf / task23.kt
Created December 23, 2018 06:43
AoC 2018 Day 23
fun main() {
val input = File("data/23a").readLines().map { Bot.parse(it) }.toSet()
// Part 1
val maxRadiusBot = input.maxBy { it.r } ?: return
println(input.count { it.copy(r = 0).intersects(maxRadiusBot) })
// Part 2
val startPosition = Coord(0, 0, 0)
var currentRadius = max(input.deltaBy { it.pos.x }, max(input.deltaBy { it.pos.y }, input.deltaBy { it.pos.z }))

Keybase proof

I hereby claim:

  • I am n3o59hf on github.
  • I am n3o59hf (https://keybase.io/n3o59hf) on keybase.
  • I have a public key whose fingerprint is AF53 72BE C4F4 5397 C10D FBE2 12A8 5879 E480 4561

To claim this, I am signing this object: