Advertisement
MetalRain

Codewars - Which are in?

Mar 23rd, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Codewars.Kata.Which where
  2.  
  3. import Data.List
  4.  
  5. -- Sorry for the name of the function.
  6. inArray :: [String] -> [String] -> [String]
  7. inArray a1 a2 = nub $ sort $ foldr go [] a2 where
  8.     go word acc = acc ++ filter (\s -> isInfixOf s word) a1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement