From 79244532fb521ee316a74f6cdf6386453b98431d Mon Sep 17 00:00:00 2001 From: zuckerberg <5-zuckerberg@users.noreply.git.neet.dev> Date: Sun, 4 Dec 2022 00:10:47 -0700 Subject: [PATCH] Cleanup code --- 4/solution.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/4/solution.nix b/4/solution.nix index 341aa90..620ecbf 100644 --- a/4/solution.nix +++ b/4/solution.nix @@ -4,9 +4,7 @@ let # read input input = readFile ./input; pairs = let - readRange = s: - let l = splitString "-" s; - in [ (toInt (head l)) (toInt (last l)) ]; + readRange = s: split (a: b: [ (toInt a) (toInt b) ]) (splitString "-" s); readPair = a: b: [ (readRange a) (readRange b) ]; in map (line: split readPair (splitString "," line))