From f416a0f07c75125d1ad649b6b18dd0de24cd111d Mon Sep 17 00:00:00 2001 From: Logiar Date: Thu, 5 Dec 2024 15:21:00 +0100 Subject: [PATCH] Or not? --- day02.kts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/day02.kts b/day02.kts index a8ae109..e1777d0 100755 --- a/day02.kts +++ b/day02.kts @@ -8,6 +8,9 @@ var safelines = 0 var dampenedsafelines = 0 while (scanner.hasNextLine()) { val line = scanner.nextLine() + if (line.isEmpty()) { + continue + } val numbers = line.split(" ").map { it.toInt() } if (isSafe(numbers)) { safelines++