From 397a741931bec4815cfbb8e8fb2cc4688fcf0f03 Mon Sep 17 00:00:00 2001 From: pingu Date: Mon, 9 Dec 2024 11:02:42 +0100 Subject: [PATCH] Fit works as expected, sort needs work --- app/9.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/9.hs b/app/9.hs index 3b3da21..1501151 100644 --- a/app/9.hs +++ b/app/9.hs @@ -34,7 +34,7 @@ fit :: [[ℜ]] -> [ℜ] -> [ℜ] fit s t = let (p,a) = break (elem None) s (n,a') = span (elem None) a in if null n then concat s ++ t else - concat p ++ if length n >= length t then t ++ concat a' ++ replicate (length n) None else fit a' t + concat p ++ if length (head n) >= length t then t ++ replicate (length n) None ++ concat a' else concat n ++ fit a' t sort2 :: [ℜ] -> [ℜ] sort2 s = let c = chunks s -- TODO: needs more work here