summaryrefslogtreecommitdiff
path: root/2020/19.hs
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-12-27 14:09:22 +0100
committerTom Smeding <tom.smeding@gmail.com>2020-12-27 14:09:22 +0100
commit833fcf24d661ef600d00c017ce7796b2fc938a17 (patch)
tree6e87577f23113e3be18fec3c6b297a9fbdc2dbb2 /2020/19.hs
parenta03c0ce5608b23a351886efbbeaa30cef19c284f (diff)
Day 20
Diffstat (limited to '2020/19.hs')
-rw-r--r--2020/19.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/2020/19.hs b/2020/19.hs
index 3ae886f..a3afb8f 100644
--- a/2020/19.hs
+++ b/2020/19.hs
@@ -34,8 +34,7 @@ matches :: Gram -> [Int] -> String -> Bool
matches _ [] [] = True
matches gram@(Gram arr) (r:rs) (c:cs) =
case arr A.! r of
- S c' | c == c' -> matches gram rs cs
- | otherwise -> False
+ S c' -> c == c' && matches gram rs cs
D alts -> any (\alt -> matches gram (alt ++ rs) (c:cs)) alts
matches _ _ _ = False