Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- strings :: Int -> [ String ]
- strings 0 = [""]
- strings n = concat ( map (\ x -> map (\ tail -> x : tail ) tails ) ['a'.. 'z'])
- where tails = strings (n -1)
- paliTest :: String -> Bool
- paliTest "" = True
- paliTest a = (a == reverse a)
- paliListN :: [String] -> [String]
- paliListN (x:xs)= if(paliTest x) then x:paliListN xs
- else paliListN xs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement