Closed
Description
Hi! There is a problem in a function, if we eval isSubsequenceOf "bl" "baaal" it would return True.
I've solve this task like this:
isSubsequenceOf :: Eq a => [a] -> [a] -> Bool
isSubsequenceOf xs ys = go xs ys
where
go [] _ = True
go _ [] = False
go (a:as) (b:bs) = (a == b && go as bs) || go xs bs
So I haven't found usage for xs@(x:_) syntax in this task:(
Metadata
Metadata
Assignees
Labels
No labels