projects
/
advent-of-code-24.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f33bcd
)
Fixed typo
author
Neil Smith
<NeilNjae@users.noreply.github.com>
Mon, 9 Dec 2024 15:56:13 +0000
(15:56 +0000)
committer
Neil Smith
<NeilNjae@users.noreply.github.com>
Mon, 9 Dec 2024 15:56:13 +0000
(15:56 +0000)
advent09/Main.hs
patch
|
blob
|
history
diff --git
a/advent09/Main.hs
b/advent09/Main.hs
index 15f5b9e6a34e282791143581b1089737e970da15..6d85624cdacb89f68a0e3002fc1a952b4cbfe210 100644
(file)
--- a/
advent09/Main.hs
+++ b/
advent09/Main.hs
@@
-110,7
+110,7
@@
packFile fid disk
| isNothing gap = disk
| otherwise = prefix ++ [Used fSize fid, Free (gapSize - fSize)] ++ mid ++ [Free fSize] ++ suffix
where
- (
o
refixMid, ((Used fSize _) : suffix)) = span ((/= fid) . fileID) disk
+ (
p
refixMid, ((Used fSize _) : suffix)) = span ((/= fid) . fileID) disk
gap = findFree fSize prefixMid
(prefix, Free gapSize, mid) = fromJust gap