Skip to content

Commit

Permalink
some minor day 7 improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
norganos committed Dec 7, 2023
1 parent 78e78c0 commit 50082bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/de/linkel/aoc/Day07.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class Day07: AbstractLinesAdventDay<Long>() {
.sortedWith { a, b ->
b.type.compareTo(a.type)
.takeIf { it != 0 }
?: (0..4).firstNotNullOfOrNull { i ->
a.values[i].compareTo(b.values[i])
?: a.values.zip(b.values).firstNotNullOfOrNull { (ca, cb) ->
ca.compareTo(cb)
.takeIf { it != 0 }
} ?: 0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ abstract class AbstractFileAdventDay<T>: AdventDay<T> {
val result = measureTimedValue {
process(part, reader)
}
println("Solution is $${result.value}")
println("Solution is ${result.value}")
println ("calculation took ${msFormat.format(result.duration.inWholeMicroseconds / 1000F)}ms")
return result.value
}
Expand Down

0 comments on commit 50082bb

Please sign in to comment.