diff options
Diffstat (limited to '2020/19.hs')
-rw-r--r-- | 2020/19.hs | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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 |