Skip to content

Commit 1782999

Browse files
committed
2022/Day 15
1 parent 91b79b6 commit 1782999

File tree

1 file changed

+2
-2
lines changed
  • src/main/kotlin/me/grison/aoc/y2022

1 file changed

+2
-2
lines changed

src/main/kotlin/me/grison/aoc/y2022/Day15.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Day15 : Day(15, 2022) {
3333
override fun partTwo(): Long {
3434
val data = data()
3535

36-
for (i in 3_000_000..4_000_000) {
36+
for (i in 3_000_000L..4_000_000L) {
3737
val bounds = mutableListOf<LPosition>()
3838
for ((sensor, beacon) in data) {
3939
val distance = sensor.manhattan(beacon)
@@ -46,7 +46,7 @@ class Day15 : Day(15, 2022) {
4646
var last = 0L
4747
for ((bx, by) in bounds) {
4848
if (bx > last)
49-
return i * 4000000L + (bx-1)
49+
return i * 4_000_000L + bx.dec()
5050
last = max(last, by);
5151
}
5252
}

0 commit comments

Comments
 (0)