There was an error while loading. Please reload this page.
1 parent 91b79b6 commit 1782999Copy full SHA for 1782999
src/main/kotlin/me/grison/aoc/y2022/Day15.kt
@@ -33,7 +33,7 @@ class Day15 : Day(15, 2022) {
33
override fun partTwo(): Long {
34
val data = data()
35
36
- for (i in 3_000_000..4_000_000) {
+ for (i in 3_000_000L..4_000_000L) {
37
val bounds = mutableListOf<LPosition>()
38
for ((sensor, beacon) in data) {
39
val distance = sensor.manhattan(beacon)
@@ -46,7 +46,7 @@ class Day15 : Day(15, 2022) {
46
var last = 0L
47
for ((bx, by) in bounds) {
48
if (bx > last)
49
- return i * 4000000L + (bx-1)
+ return i * 4_000_000L + bx.dec()
50
last = max(last, by);
51
}
52
0 commit comments