From 80685d4a8bfb2d842b398723e260c2d3403e6d38 Mon Sep 17 00:00:00 2001 From: Eric Mertens Date: Mon, 9 Dec 2024 10:14:50 -0800 Subject: [PATCH] simplify --- solutions/src/2024/09.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/solutions/src/2024/09.hs b/solutions/src/2024/09.hs index 77e3f1e..27bf858 100644 --- a/solutions/src/2024/09.hs +++ b/solutions/src/2024/09.hs @@ -104,7 +104,6 @@ moveAll files free = fst (Map.foldrWithKey' move1 (0, free) files) -- contiguous free block. move1 :: Int -> (Int, Int) -> (Int, Map Int Int) -> (Int, Map Int Int) move1 offset (fileId, fileSize) (acc, free) = - seq acc $ case [(k, v) | (k, v) <- Map.assocs free, then takeWhile by k < offset, v >= fileSize] of [] -> (acc + checksumOf offset fileId fileSize, free) (k, v) : _ -> (acc + checksumOf k fileId fileSize, free')