Bit of debugging3
Some checks failed
Solve / example-action (push) Failing after 42s

This commit is contained in:
Logiar 2024-12-05 15:15:45 +01:00
parent a36d0efd4b
commit 6a42539f09
Signed by: Logiar
SSH Key Fingerprint: SHA256:tq77C31em1ZG4oELIHC3k62wq5UzPSXmhqH8g62whIY
2 changed files with 3 additions and 3809 deletions

View File

@ -17,6 +17,9 @@ val xMasSearchOffsets = listOf(
var ycoordinates = mutableListOf<List<String>>()
while (scanner.hasNextLine()) {
val line = scanner.nextLine()
if (line.isEmpty()) {
continue
}
val xcoordinates = line.split("").filter { it.isNotEmpty() }
ycoordinates.add(xcoordinates)
}
@ -34,12 +37,10 @@ for (y in ycoordinates.indices) {
}
fun findXmas(y: Int, x: Int): Int {
println("x: $x, y: $y")
var xmasfound = 0
for (searchOffset in xMasSearchOffsets) {
val last = searchOffset.last()
if ((y+last.first) !in ycoordinates.indices || (x+last.second) !in ycoordinates[y].indices){
if (x == 1 && y == 139) println("skipping x: (${x+last.second}, y: ${y+last.first})")
continue
}
var match = true

File diff suppressed because it is too large Load Diff