From ccb408c9e2ebf34c862f942e984203a5532efc93 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Fri, 8 Dec 2023 11:25:33 +0100 Subject: [PATCH] filter empty --- Day5/Part1.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Day5/Part1.js b/Day5/Part1.js index 6ef470e..aad52a0 100644 --- a/Day5/Part1.js +++ b/Day5/Part1.js @@ -1,7 +1,10 @@ import { readFileSync } from "fs"; const t0 = performance.now(); -const categories = readFileSync("input.txt").toString().split("\n\n"); +const categories = readFileSync("input.txt") + .toString() + .split("\n\n") + .filter((e) => e.length > 0); const seeds = categories[0] .split(" ") .slice(1)