diff --git a/2021/day07/day07.hs b/2021/day07/day07.hs index 0936a99..113cb34 100644 --- a/2021/day07/day07.hs +++ b/2021/day07/day07.hs @@ -9,7 +9,6 @@ main = do let middle2 = (sum crabs) `div` genericLength crabs print $ fuel middle1 id crabs print $ fuel middle2 (\x->last $ take (x+1) $ scanl1 (+) [0..]) crabs - print middle2 fuel :: Int -> (Int -> Int) -> [Int] -> Int fuel middle f = sum . map (f . abs . subtract middle)