diff --git a/2024/src/main/kotlin/day2.kt b/2024/src/main/kotlin/day2.kt index ca8bc40..de070a1 100644 --- a/2024/src/main/kotlin/day2.kt +++ b/2024/src/main/kotlin/day2.kt @@ -28,6 +28,6 @@ private fun isSafe(report: List): Boolean { return report.fold(State()) { state, next -> state.update(next) - .also { if (!it.safe) return@fold it } + .also { if (!it.safe) return@isSafe false } }.safe }